proresdec: Fix read via negative index in a global array.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 29 Jan 2012 03:39:37 +0000 (04:39 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 2 Feb 2012 00:12:46 +0000 (01:12 +0100)
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/proresdec2.c

index fe4cfd0..9f801e4 100644 (file)
@@ -302,7 +302,7 @@ static av_always_inline void decode_dc_coeffs(GetBitContext *gb, DCTELEM *out,
     code = 5;
     sign = 0;
     for (i = 1; i < blocks_per_slice; i++, out += 64) {
-        DECODE_CODEWORD(code, dc_codebook[FFMIN(code, 6)]);
+        DECODE_CODEWORD(code, dc_codebook[FFMIN(code, 6U)]);
         if(code) sign ^= -(code & 1);
         else     sign  = 0;
         prev_dc += (((code + 1) >> 1) ^ sign) - sign;