diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 17:21:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 20:38:29 +0200 |
commit | 3e4eea6c3255ccbb059db6d5998147597e9ceccd (patch) | |
tree | 6a1e307695c02ded6c14833061b73cb67f3776c8 | |
parent | cc0fec8393ee47d8b173288b35e161fa68b0685d (diff) | |
download | ffmpeg-3e4eea6c3255ccbb059db6d5998147597e9ceccd.tar.gz |
jvdec: check videosize
Fixes null ptr dereference
fixes Ticket1364
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4904e804d3b1c56ac4f5d3386b15daae98fca2d)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-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 bdffa76da2..62674211e7 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; |