diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-03 14:45:04 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-10-03 15:09:43 +0200 |
commit | 01817d508ba59246f203b9299a3cab13d0a78145 (patch) | |
tree | 7ad95d257b9ca58da6d63992c1ae808646186a7f | |
parent | b5ef1eee4527d563f081d4dedd0290ab41f9e6bf (diff) | |
download | ffmpeg-01817d508ba59246f203b9299a3cab13d0a78145.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)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mmvideo.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index ab59b58781..baedccd7f1 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -111,7 +111,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; |