Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoakim Plate <elupus@ecce.se>2011-09-14 21:24:25 +0400
committerJoakim Plate <elupus@ecce.se>2011-09-14 21:51:07 +0400
commit1df00ac80f86119ffb03f01c757145b6942d071e (patch)
tree06781d83b14aeb339400d4a62d555913e7b2be9f /libavformat/dv.c
parent75f418064ecf5c2713151cbe6b3a716d2c047f1d (diff)
[dv] Check return value of avio_seek and avoid modifying state if it fails
Diffstat (limited to 'libavformat/dv.c')
-rw-r--r--libavformat/dv.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavformat/dv.c b/libavformat/dv.c
index becea54813..f495e1ec6e 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -475,10 +475,11 @@ static int dv_read_seek(AVFormatContext *s, int stream_index,
DVDemuxContext *c = r->dv_demux;
int64_t offset = dv_frame_offset(s, c, timestamp, flags);
- dv_offset_reset(c, offset / c->sys->frame_size);
+ if (avio_seek(s->pb, offset, SEEK_SET) < 0)
+ return -1;
- offset = avio_seek(s->pb, offset, SEEK_SET);
- return (offset < 0) ? offset : 0;
+ dv_offset_reset(c, offset / c->sys->frame_size);
+ return 0;
}
static int dv_read_close(AVFormatContext *s)