[FFmpeg-cvslog] [jvd] 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:25:43 2011 +0200| [833358172b64120331485b4ceaaa2ae74f4a0461] | committer: Joakim Plate

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

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

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

diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index ae070c5..42aae6f 100644
--- a/libavformat/jvdec.c
+++ b/libavformat/jvdec.c
@@ -207,10 +207,11 @@ static int read_seek(AVFormatContext *s, int stream_index,
 
     if (i < 0 || i >= ast->nb_index_entries)
         return 0;
+    if (avio_seek(s->pb, ast->index_entries[i].pos, SEEK_SET) < 0)
+        return -1;
 
     jv->state = JV_AUDIO;
     jv->pts   = i;
-    avio_seek(s->pb, ast->index_entries[i].pos, SEEK_SET);
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list