[FFmpeg-cvslog] avcodec/mmvideo: Bounds check 2nd line of HHV Intra blocks

Michael Niedermayer git at videolan.org
Sun Dec 21 04:50:28 CET 2014


ffmpeg | branch: release/1.1 | Michael Niedermayer <michaelni at gmx.at> | Fri Oct  3 14:45:04 2014 +0200| [d68ae96ea8d8bac872854fc617ce6ad696ff2c2d] | committer: Michael Niedermayer

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 at gmx.at>
(cherry picked from commit 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e)

Conflicts:

	libavcodec/mmvideo.c

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d68ae96ea8d8bac872854fc617ce6ad696ff2c2d
---

 libavcodec/mmvideo.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c
index 91aca94..aa61755 100644
--- a/libavcodec/mmvideo.c
+++ b/libavcodec/mmvideo.c
@@ -116,7 +116,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;



More information about the ffmpeg-cvslog mailing list