mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-30 19:58:17 +00:00
swscale/output: Fix integer overflow in yuv2ya16_X_c_template()
Found-by: colod colod <colodcolod7@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1028,7 +1028,7 @@ yuv2ya16_X_c_template(SwsInternal *c, const int16_t *lumFilter,
|
||||
int A = 0xffff;
|
||||
|
||||
for (j = 0; j < lumFilterSize; j++)
|
||||
Y += (unsigned)(lumSrc[j][i] * lumFilter[j]);
|
||||
Y += lumSrc[j][i] * (unsigned)lumFilter[j];
|
||||
|
||||
Y >>= 15;
|
||||
Y += (1<<3) + 0x8000;
|
||||
@@ -1037,7 +1037,7 @@ yuv2ya16_X_c_template(SwsInternal *c, const int16_t *lumFilter,
|
||||
if (hasAlpha) {
|
||||
A = -0x40000000 + (1<<14);
|
||||
for (j = 0; j < lumFilterSize; j++)
|
||||
A += (unsigned)(alpSrc[j][i] * lumFilter[j]);
|
||||
A += alpSrc[j][i] * (unsigned)lumFilter[j];
|
||||
|
||||
A >>= 15;
|
||||
A += 0x8000;
|
||||
|
||||
Reference in New Issue
Block a user