swresample/x86/resample: write only int16 in the int16 resampler
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 10 Jun 2026 15:48:42 +0000 (17:48 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 17 Jun 2026 03:19:53 +0000 (05:19 +0200)
commit9790e888a8f8815f19665d77aafbfb234b86b871
tree09ba23d0c256fd8f2541037f4fbc621a24507ffd
parent1c0f9900997d757741471eaa21a51a5681291bf6
swresample/x86/resample: write only int16 in the int16 resampler

The resample asm code as it is currently handles 1 sample at a time

The asm code should be redesigned and handle more than 1 sample at a
time. That is the whole purpose of SIMD. There is also multiple samples
available that need identical handling like from several channels or
similar handling from other points in time.

Such redesign would make the resampler faster and would change the
requirements of padding and maybe memory layout. So it seems simpler
to just avoid overwriting in the asm as it is today than to have
the allocation handle specific overallocation for asm code that
ideally should be redesigned

Fixes writing 16bits over the end of the array

This is an alternative fix for https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23053

Found-by: Ivan Grigorev <ivangrigoriev@meta.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 417158195367ce9335521a23905234381c5d73d0)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libswresample/x86/resample.asm