Commit 82487bf39f for ffmpeg
commit 82487bf39f3b88bcaac1387c3eb12db1708ad45f
Author: Niklas Haas <git@haasn.dev>
Date: Tue Nov 3 21:07:44 2026 +0100
swscale/x86/ops: pack SCALE constant as dword
The SSE4 path loads this as `movd`, so packing it as a u16 is technically
wrong, since it relies on implicit union padding guarantees to ensure the
remaining bytes are all 0.
Conversily, the other direction (storing as u32 and reading as u16) is
always safe since x86 is little endian.
Signed-off-by: Niklas Haas <git@haasn.dev>
diff --git a/libswscale/x86/ops.c b/libswscale/x86/ops.c
index ab9a5c7a8f..1e518a3f03 100644
--- a/libswscale/x86/ops.c
+++ b/libswscale/x86/ops.c
@@ -271,7 +271,7 @@ static int setup_scale(const SwsImplParams *params, SwsImplResult *out)
{
const SwsUOp *uop = params->uop;
switch (uop->type) {
- case SWS_PIXEL_U8: out->priv.u16[0] = uop->data.scalar.u8; break; /* for pmullw */
+ case SWS_PIXEL_U8: out->priv.u32[0] = uop->data.scalar.u8; break; /* for movd */
case SWS_PIXEL_U16: out->priv.u16[0] = uop->data.scalar.u16; break;
case SWS_PIXEL_U32: out->priv.u32[0] = uop->data.scalar.u32; break;
case SWS_PIXEL_F32: out->priv.f32[0] = uop->data.scalar.f32; break;