Prevent NULL dereference when the huffman table is invalid in the 4xm decoder.
authorLaurent Aimar <fenrir@videolan.org>
Sat, 1 Oct 2011 22:38:28 +0000 (00:38 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 2 Oct 2011 03:45:01 +0000 (05:45 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a8ff0636d67c6df059f2ae2df49ad1181de14ca)

libavcodec/4xm.c

index d89b494..1ec64ae 100644 (file)
@@ -601,9 +601,10 @@ static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const
         len_tab[j]= len;
     }
 
-    init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
-             len_tab , 1, 1,
-             bits_tab, 4, 4, 0);
+    if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
+                 len_tab , 1, 1,
+                 bits_tab, 4, 4, 0))
+        return NULL;
 
     return ptr;
 }