diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 17:21:29 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 21:06:47 +0200 |
commit | 9e4a68a76c25f82ec30d6d02ee3dba6db787de4d (patch) | |
tree | 8c3cea63e992be97d113af6135ec4a5d6f573b58 | |
parent | 25594f0018e00a092615ec67629e287c7c6d181f (diff) | |
download | ffmpeg-9e4a68a76c25f82ec30d6d02ee3dba6db787de4d.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 288e53c9d8..238cfffe7d 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; |