swscale/output: avoid signed overflow in yuv2rgba64_1 alpha

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-05-31 03:07:26 +02:00
committed by michaelni
parent ad84fc9b7d
commit 0ab097fb34
+3 -3
View File
@@ -1320,7 +1320,7 @@ yuv2rgba64_1_c_template(SwsInternal *c, const int32_t *buf0,
}
} else {
const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1];
int A1 = 0xffff<<14, A2 = 0xffff<<14;
SUINT A1 = 0xffff<<14, A2 = 0xffff<<14;
unsigned uvalpha1 = 4096 - uvalpha;
av_assert2(uvalpha <= 4096U);
@@ -1339,8 +1339,8 @@ yuv2rgba64_1_c_template(SwsInternal *c, const int32_t *buf0,
Y2 += (1 << 13) - (1 << 29);
if (hasAlpha) {
A1 = abuf0[i * 2 ] * (1 << 11);
A2 = abuf0[i * 2 + 1] * (1 << 11);
A1 = abuf0[i * 2 ] * (SUINT)(1 << 11);
A2 = abuf0[i * 2 + 1] * (SUINT)(1 << 11);
A1 += 1 << 13;
A2 += 1 << 13;