[FFmpeg-cvslog] motionpixels: check extradata size

Michael Niedermayer git at videolan.org
Sat Jun 9 21:05:14 CEST 2012


ffmpeg | branch: release/0.10 | Michael Niedermayer <michaelni at gmx.at> | Mon May 28 17:17:49 2012 +0200| [cc0fec8393ee47d8b173288b35e161fa68b0685d] | committer: Michael Niedermayer

motionpixels: check extradata size

Fixes null ptr derefernce
Fixes Ticket1363

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

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cc0fec8393ee47d8b173288b35e161fa68b0685d
---

 libavcodec/motionpixels.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 508a0aa..6b07805 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);



More information about the ffmpeg-cvslog mailing list