Commit 8332321c authored by Joakim Plate's avatar Joakim Plate Committed by Justin Ruggles

dv: Check return value of avio_seek and avoid modifying state if it fails

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJustin Ruggles <justin.ruggles@gmail.com>
parent 3371e896
...@@ -491,10 +491,11 @@ static int dv_read_seek(AVFormatContext *s, int stream_index, ...@@ -491,10 +491,11 @@ static int dv_read_seek(AVFormatContext *s, int stream_index,
DVDemuxContext *c = r->dv_demux; DVDemuxContext *c = r->dv_demux;
int64_t offset = dv_frame_offset(s, c, timestamp, flags); 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); dv_offset_reset(c, offset / c->sys->frame_size);
return (offset < 0) ? offset : 0; return 0;
} }
static int dv_read_close(AVFormatContext *s) static int dv_read_close(AVFormatContext *s)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment