diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 19:21:29 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 19:26:21 +0400 |
commit | 61a72fd9c862a5e4260c92687c1ad1d39b84f07b (patch) | |
tree | 16e60eee7d9fd5d214bf687211109c1de7955bb7 /libavcodec | |
parent | c254214ea3a69f021e2f3ce3088ba7e73833013c (diff) |
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>
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; |