[FFmpeg-cvslog] Prevent calling init_vlc() with invalid parameters in motionpixels decoder.

Laurent Aimar git at videolan.org
Thu Sep 29 06:12:07 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Sep 29 01:04:52 2011 +0200| [41b7389cade702383e59343561776f83bb26e17f] | committer: Michael Niedermayer

Prevent calling init_vlc() with invalid parameters in motionpixels decoder.

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

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

 libavcodec/motionpixels.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 1605080..165a3d1 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -279,6 +279,8 @@ static int mp_decode_frame(AVCodecContext *avctx,
     if (sz == 0)
         goto end;
 
+    if (mp->max_codes_bits <= 0)
+        goto end;
     if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0))
         goto end;
     mp_decode_frame_helper(mp, &gb);



More information about the ffmpeg-cvslog mailing list