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 7656c4c6e66f8a787d384f027ad824cc1677fda1)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
... | ... |
@@ -224,7 +224,7 @@ static void restore_median(uint8_t *src, int step, int stride, |
224 | 224 |
A = bsrc[i]; |
225 | 225 |
} |
226 | 226 |
bsrc += stride; |
227 |
- if (slice_height == 1) |
|
227 |
+ if (slice_height <= 1) |
|
228 | 228 |
continue; |
229 | 229 |
// second line - first element has top prediction, the rest uses median |
230 | 230 |
C = bsrc[-stride]; |
... | ... |
@@ -284,7 +284,7 @@ static void restore_median_il(uint8_t *src, int step, int stride, |
284 | 284 |
A = bsrc[stride + i]; |
285 | 285 |
} |
286 | 286 |
bsrc += stride2; |
287 |
- if (slice_height == 1) |
|
287 |
+ if (slice_height <= 1) |
|
288 | 288 |
continue; |
289 | 289 |
// second line - first element has top prediction, the rest uses median |
290 | 290 |
C = bsrc[-stride2]; |