4xm: prevent NULL dereference with invalid huffman table
authorLaurent Aimar <fenrir@videolan.org>
Sun, 2 Oct 2011 00:48:11 +0000 (00:48 +0000)
committerJanne Grunau <janne-libav@jannau.net>
Mon, 10 Oct 2011 19:37:36 +0000 (21:37 +0200)
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
libavcodec/4xm.c

index d428f53..21bde52 100644 (file)
@@ -602,9 +602,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;
 }