blob: b65e55fc1e8ff4191c7e82fa66ed94e279881e57 [file] [log] [blame]
Patrick Williamsb48b7b42016-08-17 15:04:38 -05001From 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e Mon Sep 17 00:00:00 2001
2From: Michael Niedermayer <michaelni@gmx.at>
3Date: Fri, 3 Oct 2014 14:45:04 +0200
4Subject: [PATCH] avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks
5
6(Upstream commit 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e)
7
8Fixes out of array access
9Fixes: asan_heap-oob_4da4f3_8_asan_heap-oob_4da4f3_419_scene1a.mm
10
11Upstream-Status: Backport
12
13Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
14Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
15Signed-off-by: Yue Tao <yue.tao@windriver.com>
16---
17 libavcodec/mmvideo.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
21index 026d463..9ff6393 100644
22--- a/gst-libs/ext/libav/libavcodec/mmvideo.c
23+++ b/gst-libs/ext/libav/libavcodec/mmvideo.c
24@@ -104,7 +104,7 @@ static void mm_decode_intra(MmContext * s, int half_horiz, int half_vert, const
25
26 if (color) {
27 memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
28- if (half_vert)
29+ if (half_vert && y + half_vert < s->avctx->height)
30 memset(s->frame.data[0] + (y+1)*s->frame.linesize[0] + x, color, run_length);
31 }
32 x+= run_length;
33--
341.7.9.5
35