Sophie

Sophie

distrib > Mageia > 1 > i586 > media > core-updates-src > by-pkgid > cc1449fd094f04e3bf58d09425996df5 > files > 37

blender-2.49b-11.3.mga1.src.rpm

Adapted from
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=8069e2f6fbd79e3d3d2ba17f5f097475b43e2921
diff -Naurp libavcodec/vc1.c libavcodec/vc1.c.mikson
--- libavcodec/vc1.c    2009-03-22 19:19:21.000000000 +0000
+++ libavcodec/vc1.c.mikson     2011-06-23 08:21:15.458483699 +0000
@@ -46,6 +46,7 @@
 #define AC_VLC_BITS 9
 static const uint16_t table_mb_intra[64][2];
 
+#define get_bits_left(gb) (gb->size_in_bits - get_bits_count(gb))
 
 /**
  * Init VC-1 specific tables and VC1Context members
@@ -2366,7 +2367,7 @@ static void vc1_decode_ac_coeff(VC1Conte
     if (index != vc1_ac_sizes[codingset] - 1) {
         run = vc1_index_decode_table[codingset][index][0];
         level = vc1_index_decode_table[codingset][index][1];
-        lst = index >= vc1_last_decode_table[codingset];
+        lst = index >= vc1_last_decode_table[codingset] || get_bits_left(gb) < 0;
         if(get_bits1(gb))
             level = -level;
     } else {