[FFmpeg-devel] [PATCH 1/2] tests/checkasm/blockdsp: Fix unaligned stores

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Tue May 7 13:29:08 EEST 2024


Fixes this test with UBSan (and maybe also on arches on which
unaligned stores trap).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
---
 tests/checkasm/blockdsp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/checkasm/blockdsp.c b/tests/checkasm/blockdsp.c
index 19d69b8687..f6f25f773e 100644
--- a/tests/checkasm/blockdsp.c
+++ b/tests/checkasm/blockdsp.c
@@ -36,8 +36,7 @@ typedef struct {
 
 #define randomize_buffers(size)             \
     do {                                    \
-        int i;                              \
-        for (i = 0; i < size; i++) {        \
+        for (int i = 0; i < size; i += 2) { \
             uint16_t r = rnd();             \
             AV_WN16A(buf0 + i, r);          \
             AV_WN16A(buf1 + i, r);          \
-- 
2.40.1



More information about the ffmpeg-devel mailing list