aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utvideodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-04 17:36:14 +0000
committerLuca Barbato <lu_zero@gentoo.org>2015-03-09 00:51:15 +0100
commit0ce3a0f9d9523a9bcad4c6d451ca5bbd7a4f420d (patch)
tree88eb00f443dc757e16ddca2827697e5dc71ff67f /libavcodec/utvideodec.c
parent7b9cb7b36543c2a0e46d99b0e41824b9e7dd0c8f (diff)
downloadffmpeg-0ce3a0f9d9523a9bcad4c6d451ca5bbd7a4f420d.tar.gz
utvideodec: Handle slice_height being zero
Fixes out of array accesses. CC: libav-stable@libav.org Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Bug-Id: CVE-2014-9604 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/utvideodec.c')
-rw-r--r--libavcodec/utvideodec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c
index 7d75c59336..bb8c7aac1e 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -213,6 +213,8 @@ static void restore_median(uint8_t *src, int step, int stride,
slice_start = ((slice * height) / slices) & cmask;
slice_height = ((((slice + 1) * height) / slices) & cmask) -
slice_start;
+ if (!slice_height)
+ continue;
bsrc = src + slice_start * stride;
@@ -269,6 +271,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;