diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-28 19:17:49 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-09 22:38:22 +0400 |
commit | cc0fec8393ee47d8b173288b35e161fa68b0685d (patch) | |
tree | b43184875b659af375ae354e2cbd530af5c3ec20 | |
parent | fa67ad85ac7ef186cfcfb5aaca5d7f743d373220 (diff) |
motionpixels: check extradata size
Fixes null ptr derefernce
Fixes Ticket1363
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 50122084a6b3be06781a2b3d8ec036f2d67c32e3)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/motionpixels.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 508a0aa26e..6b07805859 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -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); |