diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 17:21:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 17:24:13 +0200 |
commit | b4904e804d3b1c56ac4f5d3386b15daae98fca2d (patch) | |
tree | a2bf791af1146c66e7ce0b1640e3ce16ff4d201e /libavcodec | |
parent | 50122084a6b3be06781a2b3d8ec036f2d67c32e3 (diff) | |
download | ffmpeg-b4904e804d3b1c56ac4f5d3386b15daae98fca2d.tar.gz |
jvdec: check videosize
Fixes null ptr dereference
fixes Ticket1364
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/jvdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index d371950b6e..4031fadf15 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -143,6 +143,10 @@ static int decode_frame(AVCodecContext *avctx, buf += 5; if (video_size) { + if(video_size < 0) { + av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size); + return AVERROR_INVALIDDATA; + } if (avctx->reget_buffer(avctx, &s->frame) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return -1; |