Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-06-09 23:21:55 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-12 23:37:12 +0300
commit0fcc72472604b9a08f83bb4fa65d0e8d8774a002 (patch)
tree6fc0ce96b92d532dab93d7a5df857c7a5601a7dc
parent55fd698f853e290d36f41018fe1379056ec3a8b4 (diff)
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@niedermayer.cc> (cherry picked from commit 9c5250a5612d4b32d79108de0c03945b2017963e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/hevcdsp_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevcdsp_template.c b/libavcodec/hevcdsp_template.c
index 56cd9e605d..61425975cd 100644
--- a/libavcodec/hevcdsp_template.c
+++ b/libavcodec/hevcdsp_template.c
@@ -313,7 +313,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;
}