diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-09 00:43:30 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-09 01:17:41 +0100 |
commit | a92816c4eb9db66e91e6f3ecdb2f5c13225e30f1 (patch) | |
tree | e4ec17f8a3223cf54e81c356b3bb7008bcd87491 /libavcodec/golomb.h | |
parent | b8820e7aa338514ecb9891872d76a4cdf69b574e (diff) | |
download | ffmpeg-a92816c4eb9db66e91e6f3ecdb2f5c13225e30f1.tar.gz |
get_se_golomb: fix decoding of very large values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/golomb.h')
-rw-r--r-- | libavcodec/golomb.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h index 9f82c74181..66607ada21 100644 --- a/libavcodec/golomb.h +++ b/libavcodec/golomb.h @@ -187,7 +187,11 @@ static inline int get_se_golomb(GetBitContext *gb){ return ff_se_golomb_vlc_code[buf]; }else{ - log= 2*av_log2(buf) - 31; + log = av_log2(buf); + LAST_SKIP_BITS(re, gb, 31 - log); + UPDATE_CACHE(re, gb); + buf = GET_CACHE(re, gb); + buf>>= log; LAST_SKIP_BITS(re, gb, 32 - log); |