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

Joakim Plate git at videolan.org
Sat Feb 11 01:35:47 CET 2012


ffmpeg | branch: master | Joakim Plate <elupus at ecce.se> | Fri Feb  3 19:13:40 2012 +0000| [97aa092997cab8f8f337548a7c85b7fde09b4cdf] | committer: Justin Ruggles

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

Signed-off-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles at gmail.com>

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

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

diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c
index 3c51ccd..890404f 100644
--- a/libavformat/mpc8.c
+++ b/libavformat/mpc8.c
@@ -275,7 +275,8 @@ static int mpc8_read_seek(AVFormatContext *s, int stream_index, int64_t timestam
     int index = av_index_search_timestamp(st, timestamp, flags);
 
     if(index < 0) return -1;
-    avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
+    if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0)
+        return -1;
     c->frame = st->index_entries[index].timestamp;
     return 0;
 }



More information about the ffmpeg-cvslog mailing list