avcodec/bitstream: zero vlc tables on allocation
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 16 Jun 2014 16:45:18 +0000 (18:45 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 16 Jun 2014 17:10:32 +0000 (19:10 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/bitstream.c

index 5cb8631..2d3f606 100644 (file)
@@ -117,6 +117,7 @@ static int alloc_table(VLC *vlc, int size, int use_static)
             vlc->table_size = 0;
             return AVERROR(ENOMEM);
         }
+        memset(vlc->table + vlc->table_allocated - (1 << vlc->bits), 0, sizeof(VLC_TYPE) * 2 << vlc->bits);
     }
     return index;
 }