Browse Source

jvdec: check videosize

Fixes null ptr dereference
fixes Ticket1364

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4904e804d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.10.4
Michael Niedermayer 13 years ago
parent
commit
3e4eea6c32
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/jvdec.c

+ 4
- 0
libavcodec/jvdec.c View File

@@ -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;


Loading…
Cancel
Save