[FFmpeg-cvslog] avcodec/hevcdsp_template: stay within tables in sao_band_filter()
Michael Niedermayer
git at videolan.org
Fri Oct 21 23:50:59 EEST 2022
ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jun 9 22:21:55 2022 +0200| [2e8529d28258c91e79f13756bbe8009bc44ff2ae] | committer: Michael Niedermayer
avcodec/hevcdsp_template: stay within tables in sao_band_filter()
Fixes: out of array read
Fixes: 47875/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-5719393113341952
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9c5250a5612d4b32d79108de0c03945b2017963e)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2e8529d28258c91e79f13756bbe8009bc44ff2ae
---
libavcodec/hevcdsp_template.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 65dd179d0d..cc0a3c58a7 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -319,7 +319,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[src[x] >> shift]);
+ dst[x] = av_clip_pixel(src[x] + offset_table[(src[x] >> shift) & 31]);
dst += stride_dst;
src += stride_src;
}
More information about the ffmpeg-cvslog
mailing list