[FFmpeg-devel] [PATCH 3/7] Prevent NULL dereference when the huffman table is invalid in the 4xm decoder.

fenrir at elivagar.org fenrir at elivagar.org
Sun Oct 2 00:38:28 CEST 2011


From: Laurent Aimar <fenrir at videolan.org>

---
 libavcodec/4xm.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index f452114..6335879 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -619,9 +619,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;
 }
-- 
1.7.2.5



More information about the ffmpeg-devel mailing list