From 3309e0b244e92a091ec8234ee1820c4c49aec117 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 23 Oct 2024 11:40:34 +0200 Subject: [PATCH] audioconvert: don't unroll when unaligned write pointer We require the write pointer to be a multiple of 4 for our unrolled SSE loop to work, so enforce this to avoid segfaults. --- spa/plugins/audioconvert/channelmix-ops-sse.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/channelmix-ops-sse.c b/spa/plugins/audioconvert/channelmix-ops-sse.c index f7b2d59cb..5d06f0d7f 100644 --- a/spa/plugins/audioconvert/channelmix-ops-sse.c +++ b/spa/plugins/audioconvert/channelmix-ops-sse.c @@ -287,7 +287,8 @@ static inline void delay_convolve_run_sse(float *buffer, uint32_t *pos, uint32_t n, unrolled; if (SPA_IS_ALIGNED(src, 16) && - SPA_IS_ALIGNED(dst, 16)) + SPA_IS_ALIGNED(dst, 16) && + (w & 3) == 0) unrolled = n_samples & ~3; else unrolled = 0;