]> granicus.if.org Git - libx264/commitdiff
fix bs_write_ue_big for values >= 0x10000.
authorLoren Merritt <pengvado@akuvian.org>
Fri, 18 Jul 2008 02:25:03 +0000 (20:25 -0600)
committerLoren Merritt <pengvado@akuvian.org>
Fri, 18 Jul 2008 02:26:29 +0000 (20:26 -0600)
(no immediate effect, since nothing writes such values yet)

common/bs.h

index ce86bd02dcbdd63638d5cb5c722a0db8fbfd57a9..a30cf3431f09c5818587bf63eb7afe1f8651377b 100644 (file)
@@ -169,16 +169,17 @@ static inline void bs_write_ue_big( bs_t *s, unsigned int val )
     int tmp = ++val;
     if( tmp >= 0x10000 )
     {
-        bs_write32( s, 0 );
+        size = 32;
         tmp >>= 16;
     }
     if( tmp >= 0x100 )
     {
-        size = 16;
+        size += 16;
         tmp >>= 8;
     }
     size += x264_ue_size_tab[tmp];
-    bs_write( s, size, val );
+    bs_write( s, size>>1, 0 );
+    bs_write( s, (size>>1)+1, val );
 }
 
 /* Only works on values under 255. */