Browse code

Prevent NULL dereference when the huffman table is invalid in the 4xm decoder.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4a8ff0636d67c6df059f2ae2df49ad1181de14ca)

Laurent Aimar authored on 2011/10/02 07:38:28
Showing 1 changed files
... ...
@@ -601,9 +601,10 @@ static const uint8_t *read_huffman_tables(FourXContext *f, const uint8_t * const
601 601
         len_tab[j]= len;
602 602
     }
603 603
 
604
-    init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
605
-             len_tab , 1, 1,
606
-             bits_tab, 4, 4, 0);
604
+    if (init_vlc(&f->pre_vlc, ACDC_VLC_BITS, 257,
605
+                 len_tab , 1, 1,
606
+                 bits_tab, 4, 4, 0))
607
+        return NULL;
607 608
 
608 609
     return ptr;
609 610
 }