aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJoakim Plate <elupus@ecce.se>2011-09-14 19:26:48 +0200
committerJanne Grunau <janne-libav@jannau.net>2012-01-22 14:40:52 +0100
commit3359246d9a47c3f4418d994853efe17324a0159b (patch)
tree44c173d2c113e5c7d1572e381661dbdf2e7062f9 /libavformat
parent0662eea6b0b6a94753ed2fda813de1c3d8692fd8 (diff)
downloadffmpeg-3359246d9a47c3f4418d994853efe17324a0159b.tar.gz
mxfdec: check return value of avio_seek
Avoid modifying state if avio_seek fails. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mxfdec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 38e98a35a0..44dca69b1f 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1127,13 +1127,16 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
{
AVStream *st = s->streams[stream_index];
int64_t seconds;
+ int ret;
if (!s->bit_rate)
return AVERROR_INVALIDDATA;
if (sample_time < 0)
sample_time = 0;
seconds = av_rescale(sample_time, st->time_base.num, st->time_base.den);
- avio_seek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET);
+
+ if ((ret = avio_seek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET)) < 0)
+ return ret;
ff_update_cur_dts(s, st, sample_time);
return 0;
}