diff options
author | Joakim Plate <elupus@ecce.se> | 2012-02-03 19:13:39 +0000 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-02-10 15:27:49 -0500 |
commit | 9712e82a4effb08d2b422c00435af0bb00b558b6 (patch) | |
tree | a5986ef02d13db3e3471e9c007c64625d0a4bb8b /libavformat/jvdec.c | |
parent | 64476d7ee86e01f43312dc5dff850d641d2b6c9a (diff) | |
download | ffmpeg-9712e82a4effb08d2b422c00435af0bb00b558b6.tar.gz |
jvdec: Check return value of avio_seek and avoid modifying state if it fails
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Justin Ruggles <justin.ruggles@gmail.com>
Diffstat (limited to 'libavformat/jvdec.c')
-rw-r--r-- | libavformat/jvdec.c | 3 |
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; } |