aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-09-29 10:39:49 +0200
committerReinhard Tartler <siretart@tauware.de>2012-10-14 16:03:24 -0400
commit1c8e2561b48916f409980bf66ff247f001abc3b3 (patch)
treeced74688272e4d08740744137c98cfec11bce8d7
parent5c413648c1483385b74394fa40ded8e35b9ea4a2 (diff)
downloadffmpeg-1c8e2561b48916f409980bf66ff247f001abc3b3.tar.gz
indeo3: fix out of cell write.
Fixes CVE-2012-2776. CC:libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind (cherry picked from commit e4d4044339b9c3b0f45f7203cd026eda3c0414c0) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavcodec/indeo3.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c
index b7ef9e5241..294527ec9d 100644
--- a/libavcodec/indeo3.c
+++ b/libavcodec/indeo3.c
@@ -416,6 +416,9 @@ static int decode_cell_data(Cell *cell, uint8_t *block, uint8_t *ref_block,
blk_row_offset = (row_offset << (2 + v_zoom)) - (cell->width << 2);
line_offset = v_zoom ? row_offset : 0;
+ if (cell->height & v_zoom || cell->width & h_zoom)
+ return IV3_BAD_DATA;
+
for (y = 0; y < cell->height; is_first_row = 0, y += 1 + v_zoom) {
for (x = 0; x < cell->width; x += 1 + h_zoom) {
ref = ref_block;