[FFmpeg-cvslog] 4xm: prevent NULL dereference with invalid huffman table

Laurent Aimar git at videolan.org
Tue Oct 11 03:52:35 CEST 2011


ffmpeg | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Oct  2 00:48:11 2011 +0000| [1b1182ce97db7a97914bb7713eba66fee5d93937] | committer: Janne Grunau

4xm: prevent NULL dereference with invalid huffman table

Signed-off-by: Janne Grunau <janne-libav at jannau.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b1182ce97db7a97914bb7713eba66fee5d93937
---

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

diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index d428f53..21bde52 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -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;
 }



More information about the ffmpeg-cvslog mailing list