Commit 5856bca3 authored by Luca Barbato's avatar Luca Barbato Committed by Michael Niedermayer

hevc: Clip the pixel before shifting

Prevent an out of array bound read.

Fixes: asan_stack-oob_eae8e3_7333_WPP_B_ericsson_MAIN10_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 0999f161
...@@ -395,7 +395,7 @@ static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src, ...@@ -395,7 +395,7 @@ static void FUNC(sao_band_filter)(uint8_t *_dst, uint8_t *_src,
offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1]; offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
for (y = 0; y < height; y++) { for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) for (x = 0; x < width; x++)
dst[x] = av_clip_pixel(src[x] + offset_table[av_clip_pixel(src[x] >> shift)]); dst[x] = av_clip_pixel(src[x] + offset_table[av_clip_pixel(src[x]) >> shift]);
dst += stride; dst += stride;
src += stride; src += stride;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment