aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-12-13 19:38:20 +0100
committerReinhard Tartler <siretart@tauware.de>2013-01-12 19:20:27 +0100
commit9f8071245491b7060fac823b8060e06e14ca403b (patch)
treed3a8553b5ef72e6f85b7c353513e54b6f3d8ee72
parent642d758a2d829e62e32f08ae3369b41299a5bcc1 (diff)
downloadffmpeg-9f8071245491b7060fac823b8060e06e14ca403b.tar.gz
ivi_common: check that scan pattern is set before using it.
Fixes CVE-2012-2791. CC: libav-stable@libav.org (cherry picked from commit deabb52ab4c1fdb3dd319f3980b1489a182011f1) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/ivi_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c
index 22af3a7314..f55371cf73 100644
--- a/libavcodec/ivi_common.c
+++ b/libavcodec/ivi_common.c
@@ -410,6 +410,11 @@ int ff_ivi_decode_blocks(GetBitContext *gb, IVIBandDesc *band, IVITile *tile)
}
if (cbp & 1) { /* block coded ? */
+ if (!band->scan) {
+ av_log(NULL, AV_LOG_ERROR, "Scan pattern is not set.\n");
+ return AVERROR_INVALIDDATA;
+ }
+
scan_pos = -1;
memset(trvec, 0, num_coeffs*sizeof(trvec[0])); /* zero transform vector */
memset(col_flags, 0, sizeof(col_flags)); /* zero column flags */