[FFmpeg-cvslog] ff_lag_rac_init: fix signedness error leading to out of array read.

Michael Niedermayer git at videolan.org
Sun Apr 15 17:20:50 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 15 16:40:49 2012 +0200| [3118e3b137323785d131e1448c6718e9f649de73] | committer: Michael Niedermayer

ff_lag_rac_init: fix signedness error leading to out of array read.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/lagarithrac.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/lagarithrac.c b/libavcodec/lagarithrac.c
index 9f7bc41..895acb0 100644
--- a/libavcodec/lagarithrac.c
+++ b/libavcodec/lagarithrac.c
@@ -45,7 +45,7 @@ void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
 
     l->range        = 0x80;
     l->low          = *l->bytestream >> 1;
-    l->hash_shift   = FFMAX(l->scale - 8, 0);
+    l->hash_shift   = FFMAX((int)l->scale - 8, 0);
 
     for (i = j = 0; i < 256; i++) {
         unsigned r = i << l->hash_shift;



More information about the ffmpeg-cvslog mailing list