[FFmpeg-cvslog] ff_ivi_decode_blocks: fix negative scan_pos case.

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


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 15 14:58:06 2012 +0200| [93927eb334dce961603645dd4ed9772bb2400cc4] | committer: Michael Niedermayer

ff_ivi_decode_blocks: fix negative scan_pos case.

Fixes out of global 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=93927eb334dce961603645dd4ed9772bb2400cc4
---

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

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



More information about the ffmpeg-cvslog mailing list