aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-05-28 17:17:49 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-09 21:35:03 +0200
commit9291fc881384201760df69dadf16fe5d8710e15a (patch)
treea866397f2098d0617a15cff58417c505dc764da6
parent62cbdd71eb2c0051cc5a9797db5ea82399337344 (diff)
downloadffmpeg-9291fc881384201760df69dadf16fe5d8710e15a.tar.gz
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 91f28cfe62..4af56abe37 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -53,6 +53,11 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
{
MotionPixelsContext *mp = avctx->priv_data;
+ 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);