[FFmpeg-cvslog] avcodec/utvideodec: Fix handling of slice_height=0
Michael Niedermayer
git at videolan.org
Thu Dec 18 19:21:16 CET 2014
ffmpeg | branch: release/1.2 | Michael Niedermayer <michaelni at gmx.at> | Tue Dec 16 20:45:31 2014 +0100| [ece0c9c4b04257d8ba3689987251f44421b1ead7] | committer: Michael Niedermayer
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 at gmx.at>
(cherry picked from commit 3881606240953b9275a247a1c98a567f3c44890f)
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ece0c9c4b04257d8ba3689987251f44421b1ead7
---
libavcodec/utvideodec.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 5c1d45c..0e4dddb 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;
More information about the ffmpeg-cvslog
mailing list