aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-10-03 14:45:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-03 15:12:37 +0200
commit76601e4ab8f5d304906766bffabefbc3791819e9 (patch)
tree6c1d5d17c7dc9fb698be0df9d8d184d599d5b390
parente90d620cb93eb23a17b8803d8bb164c903633378 (diff)
downloadffmpeg-76601e4ab8f5d304906766bffabefbc3791819e9.tar.gz
avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
Fixes out of array access Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e) Conflicts: libavcodec/mmvideo.c Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mmvideo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index b74424cc13..38aeac0384 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -109,7 +109,7 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
if (color) {
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
- if (half_vert)
+ if (half_vert && y + half_vert < s->avctx->height)
memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
}
x+= run_length;