[FFmpeg-cvslog] [mxfdec] Check return value of avio_seek and avoid modifying state if it fails

Joakim Plate git at videolan.org
Wed Sep 14 20:05:36 CEST 2011


ffmpeg | branch: master | Joakim Plate <elupus at ecce.se> | Wed Sep 14 19:26:48 2011 +0200| [a3f4fc813d479fb1f80aef180c17d6cffb4339ef] | committer: Joakim Plate

[mxfdec] Check return value of avio_seek and avoid modifying state if it fails

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a3f4fc813d479fb1f80aef180c17d6cffb4339ef
---

 libavformat/mxfdec.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 307a2b2..9adeb1f 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1119,7 +1119,8 @@ static int mxf_read_seek(AVFormatContext *s, int stream_index, int64_t sample_ti
     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 (avio_seek(s->pb, (s->bit_rate * seconds) >> 3, SEEK_SET) < 0)
+        return -1;
     av_update_cur_dts(s, st, sample_time);
     return 0;
 }



More information about the ffmpeg-cvslog mailing list