From 09d3370c2884f4535d738e9baea008738cfb602b Mon Sep 17 00:00:00 2001 From: Wu Jianhua Date: Fri, 31 May 2024 00:28:05 +0800 Subject: [PATCH] avcodec/x86/vvc/vvc_alf: fix integer overflow Some tests fails with certain seeds tests/checkasm/checkasm 2325607578 --test=vvc_alf checkasm: using random seed 2325607578 AVX2: vvc_alf_filter_luma_120x20_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x24_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x28_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x32_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x36_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x40_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x44_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x48_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x52_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x56_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x60_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x64_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x68_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x72_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x76_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x80_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x84_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x88_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x92_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x96_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x100_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x104_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x108_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x112_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x116_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x120_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x124_12_avx2 (vvc_alf.c:104) vvc_alf_filter_luma_120x128_12_avx2 (vvc_alf.c:104) - vvc_alf.alf_filter [FAILED] - vvc_alf.alf_classify [OK] checkasm: 28 of 9216 tests have failed Reported-by: James Almer Signed-off-by: Wu Jianhua --- libavcodec/x86/vvc/vvc_alf.asm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/x86/vvc/vvc_alf.asm b/libavcodec/x86/vvc/vvc_alf.asm index 71e821c27b..f7b3e2a6cc 100644 --- a/libavcodec/x86/vvc/vvc_alf.asm +++ b/libavcodec/x86/vvc/vvc_alf.asm @@ -356,7 +356,8 @@ SECTION .text FILTER_VB xq - paddw m0, m2 + ; sum += curr + paddsw m0, m2 ; clip to pixel CLIPW m0, m14, m15