diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-16 20:45:31 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-16 23:00:04 +0100 |
commit | 3881606240953b9275a247a1c98a567f3c44890f (patch) | |
tree | c67a14c55b809213ac7cc3c24a6a22bacb93f14e | |
parent | a9a3c005b889fa44183d5a0118a34402c07b1cab (diff) | |
download | ffmpeg-3881606240953b9275a247a1c98a567f3c44890f.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>
-rw-r--r-- | libavcodec/utvideodec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index b565c1076c..3a3c46e0bc 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -215,6 +215,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 @@ -270,6 +272,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; |