aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/utvideodec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-04 17:36:14 +0000
committerReinhard Tartler <siretart@tauware.de>2015-03-08 22:04:40 -0400
commite032e647dd79e7748145792dfee0358eccb1982e (patch)
treea79116151d4b7a426f7558e4d78cd1c96c9035ba /libavcodec/utvideodec.c
parenteb9041403d820634c45ed4ee98570246a252507a (diff)
downloadffmpeg-e032e647dd79e7748145792dfee0358eccb1982e.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> (cherry picked from commit 0ce3a0f9d9523a9bcad4c6d451ca5bbd7a4f420d) (cherry picked from commit 3a417a86b330b7c1acf9db4f729be7d619caaded) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
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 349259577b..c4a75c9a79 100644
--- a/libavcodec/utvideodec.c
+++ b/libavcodec/utvideodec.c
@@ -211,6 +211,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;
@@ -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;