summaryrefslogtreecommitdiff
path: root/libavcodec/golomb.h
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2009-02-24 01:41:44 +0000
committerMåns Rullgård <mans@mansr.com>2009-02-24 01:41:44 +0000
commitd4f2a6250aa0598a4a6414a3eb34e4f462b290b0 (patch)
treec063187c8b51f3b1bb6f725ebccada6c6f1b4627 /libavcodec/golomb.h
parentd3bcbf57a9f4b6d9b48524522fb05b553f786312 (diff)
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. Originally committed as revision 17550 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r--libavcodec/golomb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 989a87a88e..59b4f9eca0 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -273,7 +273,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit, int
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);