avcodec/utvideodec: fix assumtation that slice_height >= 1
Fixes out of array read
Fixes: asan_heap-oob_2573085_3783_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7656c4c6e6
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -224,7 +224,7 @@ static void restore_median(uint8_t *src, int step, int stride,
|
|||||||
A = bsrc[i];
|
A = bsrc[i];
|
||||||
}
|
}
|
||||||
bsrc += stride;
|
bsrc += stride;
|
||||||
if (slice_height == 1)
|
if (slice_height <= 1)
|
||||||
continue;
|
continue;
|
||||||
// second line - first element has top prediction, the rest uses median
|
// second line - first element has top prediction, the rest uses median
|
||||||
C = bsrc[-stride];
|
C = bsrc[-stride];
|
||||||
@@ -284,7 +284,7 @@ static void restore_median_il(uint8_t *src, int step, int stride,
|
|||||||
A = bsrc[stride + i];
|
A = bsrc[stride + i];
|
||||||
}
|
}
|
||||||
bsrc += stride2;
|
bsrc += stride2;
|
||||||
if (slice_height == 1)
|
if (slice_height <= 1)
|
||||||
continue;
|
continue;
|
||||||
// second line - first element has top prediction, the rest uses median
|
// second line - first element has top prediction, the rest uses median
|
||||||
C = bsrc[-stride2];
|
C = bsrc[-stride2];
|
||||||
|
Reference in New Issue
Block a user