[FFmpeg-cvslog] get_se_golomb: fix decoding of very large values

Michael Niedermayer git at videolan.org
Sat Feb 9 01:19:31 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Feb  9 00:43:30 2013 +0100| [a92816c4eb9db66e91e6f3ecdb2f5c13225e30f1] | committer: Michael Niedermayer

get_se_golomb: fix decoding of very large values

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a92816c4eb9db66e91e6f3ecdb2f5c13225e30f1
---

 libavcodec/golomb.h |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 9f82c74..66607ad 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);



More information about the ffmpeg-cvslog mailing list