mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-08 06:09:50 +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>
(cherry picked from commit 0c6b7f9483)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
f39917c627
commit
ac4caa33ba
1 changed files with 2 additions and 2 deletions
|
|
@ -943,7 +943,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;
|
||||
|
|
@ -952,7 +952,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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue