[FFmpeg-cvslog] avcodec/golomb: fix reading huge signed rice golomb values

Michael Niedermayer git at videolan.org
Sun May 17 19:37:40 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May 17 19:08:38 2015 +0200| [14c4b2515836811d53bb5696951637537353387f] | committer: Michael Niedermayer

avcodec/golomb: fix reading huge signed rice golomb values

No testcase is known, nor any case where such huge values would occur

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

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

 libavcodec/golomb.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 134e6ac..d8c1a41 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -367,7 +367,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
 static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
                                 int esc_len)
 {
-    int v = get_ur_golomb(gb, k, limit, esc_len);
+    unsigned v = get_ur_golomb(gb, k, limit, esc_len);
     return (v >> 1) ^ -(v & 1);
 }
 
@@ -377,7 +377,7 @@ static inline int get_sr_golomb(GetBitContext *gb, int k, int limit,
 static inline int get_sr_golomb_flac(GetBitContext *gb, int k, int limit,
                                      int esc_len)
 {
-    int v = get_ur_golomb_jpegls(gb, k, limit, esc_len);
+    unsigned v = get_ur_golomb_jpegls(gb, k, limit, esc_len);
     return (v >> 1) ^ -(v & 1);
 }
 



More information about the ffmpeg-cvslog mailing list