Fixed deference of NULL pointer in motionpixels decoder.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 10 Sep 2011 11:28:13 +0000 (13:28 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 21 Sep 2011 16:00:10 +0000 (18:00 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 824f98f442996eaee9204b132752cf5114fc94cf)

libavcodec/motionpixels.c

index 01558ab..b18efa6 100644 (file)
@@ -279,7 +279,8 @@ static int mp_decode_frame(AVCodecContext *avctx,
     if (sz == 0)
         goto end;
 
-    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);
+    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);
     free_vlc(&mp->vlc);