summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoakim Plate <[email protected]>2012-02-03 19:13:39 +0000
committerJustin Ruggles <[email protected]>2012-02-10 15:27:49 -0500
commit9712e82a4effb08d2b422c00435af0bb00b558b6 (patch)
treea5986ef02d13db3e3471e9c007c64625d0a4bb8b
parent64476d7ee86e01f43312dc5dff850d641d2b6c9a (diff)
jvdec: Check return value of avio_seek and avoid modifying state if it fails
Signed-off-by: Paul B Mahol <[email protected]> Signed-off-by: Justin Ruggles <[email protected]>
-rw-r--r--libavformat/jvdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index 82d96ca071..c42e302bda 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;
}