diff golomb.h @ 9020:97b991a32b85 libavcodec

Fix get_ur_golomb_jpegls() with A32_BITSTREAM_READER If k==0, log==0 can indicate that the coded value uses more than MIN_CACHE_BITS bits. With MIN_CACHE_BITS==32, the fast branch is incorrectly taken in this case unless explicitly forbidden.
author mru
date Tue, 24 Feb 2009 01:41:44 +0000
parents 9218ef5d5afb
children 4cb7c65fc775
line wrap: on
line diff
--- a/golomb.h	Tue Feb 24 01:12:25 2009 +0000
+++ b/golomb.h	Tue Feb 24 01:41:44 2009 +0000
@@ -273,7 +273,7 @@
 
     log= av_log2(buf);
 
-    if(log - k >= 32-MIN_CACHE_BITS && 32-log < limit){
+    if(log - k >= 32-MIN_CACHE_BITS+(MIN_CACHE_BITS==32) && 32-log < limit){
         buf >>= log - k;
         buf += (30-log)<<k;
         LAST_SKIP_BITS(re, gb, 32 + k - log);