]> granicus.if.org Git - libx264/commitdiff
Fix undefined behavior of left shift for CAVLC encoding
authorAnton Mitrofanov <BugMaster@narod.ru>
Wed, 18 Jul 2018 18:56:33 +0000 (21:56 +0300)
committerHenrik Gramner <henrik@gramner.com>
Sat, 21 Jul 2018 17:50:34 +0000 (19:50 +0200)
common/vlc.c

index 6e695d233dc974c373b7b05f9a4774f4bc4a2756..e00a01bc2e170e9b7f2064cd84c7e1d19d942151 100644 (file)
@@ -71,7 +71,9 @@ void x264_cavlc_init( x264_t *h )
             vlc->i_next = i_next;
         }
 
-    for( int i = 1; i < (1<<16); i++ )
+    x264_run_before[0] = 0;
+    x264_run_before[1] = 0;
+    for( uint32_t i = 2; i < (1<<16); i++ )
     {
         x264_run_level_t runlevel;
         ALIGNED_ARRAY_16( dctcoef, dct, [16] );