changeset 2463:9baa47d8297b libavcodec

check norm6 vlc validity as there are some bit sequences which dont corespond to any codeword, the other vlc tables all seem to be huffman tables though
author michael
date Tue, 25 Jan 2005 01:29:10 +0000
parents 5fd4de95731f
children ab390f13c7f5
files vc9.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vc9.c	Mon Jan 24 23:01:18 2005 +0000
+++ b/vc9.c	Tue Jan 25 01:29:10 2005 +0000
@@ -852,6 +852,10 @@
         for(y=  bp->height%tile_h; y< bp->height; y+=tile_h){
             for(x=  bp->width%tile_w; x< bp->width; x+=tile_w){
                 code = get_vlc2(&v->gb, vc9_norm6_vlc.table, VC9_NORM6_VLC_BITS, 2);
+                if(code<0){
+                    av_log(v->avctx, AV_LOG_DEBUG, "inavlid NORM-6 VLC\n");
+                    return -1;
+                }
                 //FIXME following is a pure guess and probably wrong
                 //FIXME A bitplane (0 | !0), so could the shifts be avoided ?
                 planep[x     + 0*bp->stride]= (code>>0)&1;