Browse code

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

Joakim Plate authored on 2011/09/15 02:25:43
Showing 1 changed files
... ...
@@ -207,10 +207,11 @@ static int read_seek(AVFormatContext *s, int stream_index,
207 207
 
208 208
     if (i < 0 || i >= ast->nb_index_entries)
209 209
         return 0;
210
+    if (avio_seek(s->pb, ast->index_entries[i].pos, SEEK_SET) < 0)
211
+        return -1;
210 212
 
211 213
     jv->state = JV_AUDIO;
212 214
     jv->pts   = i;
213
-    avio_seek(s->pb, ast->index_entries[i].pos, SEEK_SET);
214 215
     return 0;
215 216
 }
216 217