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

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


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

tta: 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=e54165aa392322bbeeb823fc33a17336e465b7b5
---

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

diff --git a/libavformat/tta.c b/libavformat/tta.c
index 4d6bc0a..d7d4117 100644
--- a/libavformat/tta.c
+++ b/libavformat/tta.c
@@ -142,9 +142,10 @@ static int tta_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
     int index = av_index_search_timestamp(st, timestamp, flags);
     if (index < 0)
         return -1;
+    if (avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET) < 0)
+        return -1;
 
     c->currentframe = index;
-    avio_seek(s->pb, st->index_entries[index].pos, SEEK_SET);
 
     return 0;
 }



More information about the ffmpeg-cvslog mailing list