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 commit0ce3a0f9d9) (cherry picked from commit3a417a86b3) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
parent
eb9041403d
commit
e032e647dd
1 changed files with 4 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue