aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-12-16 20:45:31 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-16 23:06:36 +0100
commitece0c9c4b04257d8ba3689987251f44421b1ead7 (patch)
tree1de63dfc9d982e68fbd48633c3884fcba61a7358 /libavcodec
parent0da0d7754e745d066f845da499383ff86d2ce04f (diff)
downloadffmpeg-ece0c9c4b04257d8ba3689987251f44421b1ead7.tar.gz
avcodec/utvideodec: Fix handling of slice_height=0
Fixes out of array accesses Fixes: asan_heap-oob_25bcd7e_3783_cov_3553517262_utvideo_rgba_median.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 3881606240953b9275a247a1c98a567f3c44890f) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/utvideodec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 5c1d45ca80..0e4dddbbf1 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -212,6 +212,8 @@ static void restore_median(uint8_t *src, int step, int stride,
slice_height = ((((slice + 1) * height) / slices) & cmask) -
slice_start;
+ if (!slice_height)
+ continue;
bsrc = src + slice_start * stride;
// first line - left neighbour prediction
@@ -267,6 +269,8 @@ static void restore_median_il(uint8_t *src, int step, int stride,
slice_height = ((((slice + 1) * height) / slices) & cmask) -
slice_start;
slice_height >>= 1;
+ if (!slice_height)
+ continue;
bsrc = src + slice_start * stride;