Browse code

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

Joakim Plate authored on 2011/09/15 02:33:05
Showing 1 changed files
... ...
@@ -173,7 +173,8 @@ static int tmv_read_seek(AVFormatContext *s, int stream_index,
173 173
     pos = timestamp *
174 174
           (tmv->audio_chunk_size + tmv->video_chunk_size + tmv->padding);
175 175
 
176
-    avio_seek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET);
176
+    if (avio_seek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET) < 0)
177
+        return -1;
177 178
     tmv->stream_index = 0;
178 179
     return 0;
179 180
 }