[FFmpeg-cvslog] nsvdec: 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:41 2012 +0000| [8dcd00eabddab5e3366173391b87fa99e9132c36] | committer: Justin Ruggles

nsvdec: 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=8dcd00eabddab5e3366173391b87fa99e9132c36
---

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

diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c
index 2ad8cb3..c5655d2 100644
--- a/libavformat/nsvdec.c
+++ b/libavformat/nsvdec.c
@@ -720,7 +720,9 @@ static int nsv_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
     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;
+
     nst->frame_offset = st->index_entries[index].timestamp;
     nsv->state = NSV_UNSYNC;
     return 0;



More information about the ffmpeg-cvslog mailing list