diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-01-11 16:52:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-11 20:33:05 +0100 |
commit | 5856bca360c5bc3e340a357d91b1f993c80a7bea (patch) | |
tree | 24212e1ece3ee8fe8934f1745c5e62f696b47457 /libavcodec | |
parent | 0999f1613bc48ed9d6578a3ad7bcd17610e07fbf (diff) | |
download | ffmpeg-streaming-5856bca360c5bc3e340a357d91b1f993c80a7bea.zip ffmpeg-streaming-5856bca360c5bc3e340a357d91b1f993c80a7bea.tar.gz |
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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevcdsp_template.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c index 553c4c3..a876ee4 100644 --- a/libavcodec/hevcdsp_template.c +++ b/libavcodec/hevcdsp_template.c @@ -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]; for (y = 0; y < height; y++) { 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; src += stride; } |