summaryrefslogtreecommitdiff
path: root/libavformat/jvdec.c
diff options
context:
space:
mode:
authorJoakim Plate <elupus@ecce.se>2011-09-14 19:25:43 +0200
committerJoakim Plate <elupus@ecce.se>2011-09-14 19:53:39 +0200
commit833358172b64120331485b4ceaaa2ae74f4a0461 (patch)
tree57c3c977b18110a71c3c5ab6d5944e193e15a684 /libavformat/jvdec.c
parent58540d7bd3561593d48f76db9096ede118a0a6b1 (diff)
downloadffmpeg-833358172b64120331485b4ceaaa2ae74f4a0461.tar.gz
[jvd] Check return value of avio_seek and avoid modifying state if it fails
Diffstat (limited to 'libavformat/jvdec.c')
-rw-r--r--libavformat/jvdec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c
index ae070c5e96..42aae6f57a 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;
}