[FFmpeg-devel] [PATCH] checkasm/hevc_pel: fix stack-buffer-overflow

Zhao Zhili quinkblack at foxmail.com
Tue Sep 21 12:14:07 EEST 2021


==225880==ERROR: AddressSanitizer: stack-buffer-overflow on address ...
READ of size 2 at 0x7fffe49ab400 thread T0
    #0 0x18301da in put_hevc_qpel_hv_9 src/libavcodec/hevcdsp_template.c:666
    #1 0x6c6bc4 in checkasm_check_hevc_qpel src/tests/checkasm/hevc_pel.c:97
    #2 0x6cecc8 in checkasm_check_hevc_pel src/tests/checkasm/hevc_pel.c:528
---
 tests/checkasm/hevc_pel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/checkasm/hevc_pel.c b/tests/checkasm/hevc_pel.c
index ec24309081..3dc7cd9090 100644
--- a/tests/checkasm/hevc_pel.c
+++ b/tests/checkasm/hevc_pel.c
@@ -34,7 +34,7 @@ static const int denoms[] = {0, 7, 12, -1 };
 static const int offsets[] = {0, 255, -1 };
 
 #define SIZEOF_PIXEL ((bit_depth + 7) / 8)
-#define BUF_SIZE (2 * MAX_PB_SIZE * (2 * 4 + MAX_PB_SIZE))
+#define BUF_SIZE (2 * MAX_PB_SIZE * (2 * 4 + MAX_PB_SIZE) + 8)
 
 #define randomize_buffers()                          \
     do {                                             \
-- 
2.31.1



More information about the ffmpeg-devel mailing list