[FFmpeg-cvslog] [r3d] 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:32:29 2011 +0200| [425907809b48a7f44c0508e3dc09b8ba0c023d06] | committer: Joakim Plate

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

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

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

diff --git a/libavformat/r3d.c b/libavformat/r3d.c
index 4658ea1..d84fd2c 100644
--- a/libavformat/r3d.c
+++ b/libavformat/r3d.c
@@ -365,7 +365,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;



More information about the ffmpeg-cvslog mailing list