diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-03 12:32:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-03 12:38:03 +0200 |
commit | 114f82ee7e384ff80151fe6f4ed89d46c2f20419 (patch) | |
tree | 1f7650b626fb24f4aa1084b0ed14af209843bb5e /libavcodec/jvdec.c | |
parent | 596814f9781772050c65bdd8add27445bc8374a4 (diff) | |
download | ffmpeg-114f82ee7e384ff80151fe6f4ed89d46c2f20419.tar.gz |
jvdec: check that the video_size fits in the packet.
Prevents use of out of array data and fate failure.
Found-by: durandal_1707
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jvdec.c')
-rw-r--r-- | libavcodec/jvdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index 4031fadf15..728b749896 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -143,7 +143,7 @@ static int decode_frame(AVCodecContext *avctx, buf += 5; if (video_size) { - if(video_size < 0) { + if(video_size < 0 || video_size > buf_size) { av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size); return AVERROR_INVALIDDATA; } |