mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-02-04 14:30:55 +08: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>
(cherry picked from commit 0c6b7f9483)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -965,7 +965,7 @@ yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
|
||||
int A = 0xffff;
|
||||
|
||||
for (j = 0; j < lumFilterSize; j++)
|
||||
Y += lumSrc[j][i] * lumFilter[j];
|
||||
Y += lumSrc[j][i] * (unsigned)lumFilter[j];
|
||||
|
||||
Y >>= 15;
|
||||
Y += (1<<3) + 0x8000;
|
||||
@@ -974,7 +974,7 @@ yuv2ya16_X_c_template(SwsContext *c, const int16_t *lumFilter,
|
||||
if (hasAlpha) {
|
||||
A = -0x40000000 + (1<<14);
|
||||
for (j = 0; j < lumFilterSize; j++)
|
||||
A += alpSrc[j][i] * lumFilter[j];
|
||||
A += alpSrc[j][i] * (unsigned)lumFilter[j];
|
||||
|
||||
A >>= 15;
|
||||
A += 0x8000;
|
||||
|
||||
Reference in New Issue
Block a user