summaryrefslogtreecommitdiff
path: root/libavcodec/golomb.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r--libavcodec/golomb.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 7044042c95..c227607f1f 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -253,8 +253,12 @@ static inline int get_ur_golomb(GetBitContext *gb, int k, int limit, int esc_len
return buf;
}else{
- buf >>= 32 - limit - esc_len;
- LAST_SKIP_BITS(re, gb, esc_len + limit);
+ LAST_SKIP_BITS(re, gb, limit);
+ UPDATE_CACHE(re, gb);
+
+ buf = SHOW_UBITS(re, gb, esc_len);
+
+ LAST_SKIP_BITS(re, gb, esc_len);
CLOSE_READER(re, gb);
return buf + limit - 1;