ff_ivi_decode_blocks: fix negative scan_pos case.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 15 Apr 2012 12:58:06 +0000 (14:58 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 15 Apr 2012 12:59:21 +0000 (14:59 +0200)
Fixes out of global array read.

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

index ba8853b..c5039b3 100644 (file)
@@ -417,7 +417,7 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
 
                     /* de-zigzag and dequantize */
                     scan_pos += run;
 
                     /* de-zigzag and dequantize */
                     scan_pos += run;
-                    if (scan_pos >= num_coeffs)
+                    if (scan_pos >= (unsigned)num_coeffs)
                         break;
                     pos = band->scan[scan_pos];
 
                         break;
                     pos = band->scan[scan_pos];