Browse Source

vcr1dec: Check that there is sufficient input data.

Fixes crash.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.10
Michael Niedermayer 14 years ago
parent
commit
8e09482e4d
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/vcr1.c

+ 5
- 0
libavcodec/vcr1.c View File

@@ -56,6 +56,11 @@ static int decode_frame(AVCodecContext *avctx,
if(p->data[0]) if(p->data[0])
avctx->release_buffer(avctx, p); avctx->release_buffer(avctx, p);


if(buf_size < 16 + avctx->height + avctx->width*avctx->height*5/8){
av_log(avctx, AV_LOG_ERROR, "Insufficient input data.\n");
return AVERROR(EINVAL);
}

p->reference= 0; p->reference= 0;
if(avctx->get_buffer(avctx, p) < 0){ if(avctx->get_buffer(avctx, p) < 0){
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");


Loading…
Cancel
Save