]> git.sesse.net Git - ffmpeg/commitdiff
r3d: Check return value of avio_seek and avoid modifying state if it fails
authorJoakim Plate <elupus@ecce.se>
Fri, 3 Feb 2012 19:13:42 +0000 (19:13 +0000)
committerJustin Ruggles <justin.ruggles@gmail.com>
Fri, 10 Feb 2012 20:27:49 +0000 (15:27 -0500)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
libavformat/r3d.c

index 7f0e8de0e462bdb1497798d579cb822587fbd372..2674578aa0c49c3a53be44b47f4b63ec9468125c 100644 (file)
@@ -366,7 +366,8 @@ static int r3d_seek(AVFormatContext *s, int stream_index, int64_t sample_time, i
             frame_num, sample_time);
 
     if (frame_num < r3d->video_offsets_count) {
-        avio_seek(s->pb, r3d->video_offsets_count, SEEK_SET);
+        if (avio_seek(s->pb, r3d->video_offsets_count, SEEK_SET) < 0)
+            return -1;
     } else {
         av_log(s, AV_LOG_ERROR, "could not seek to frame %d\n", frame_num);
         return -1;