Browse Source

motionpixels: check extradata size

Fixes null ptr derefernce
Fixes Ticket1363

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

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n0.7.13
Michael Niedermayer 13 years ago
parent
commit
25594f0018
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/motionpixels.c

+ 5
- 0
libavcodec/motionpixels.c View File

@@ -55,6 +55,11 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
int w4 = (avctx->width + 3) & ~3;
int h4 = (avctx->height + 3) & ~3;

if(avctx->extradata_size < 2){
av_log(avctx, AV_LOG_ERROR, "extradata too small\n");
return AVERROR_INVALIDDATA;
}

motionpixels_tableinit();
mp->avctx = avctx;
dsputil_init(&mp->dsp, avctx);


Loading…
Cancel
Save