[FFmpeg-cvslog] swscale/output: Fix integer overflow in alpha computation in yuv2gbrp16_full_X_c()

Michael Niedermayer git at videolan.org
Sat Apr 4 23:24:08 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Feb 16 20:18:11 2020 +0100| [49ba1879add99d3f64d70d34fb0255c8a49d4b28] | committer: Michael Niedermayer

swscale/output: Fix integer overflow in alpha computation in yuv2gbrp16_full_X_c()

Fixes: signed integer overflow: 524280 * 4432 cannot be represented in type 'int'
Fixes: ticket8322

Found-by: Suhwan
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49ba1879add99d3f64d70d34fb0255c8a49d4b28
---

 libswscale/output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index a793a89443..9df6ba44c8 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2278,7 +2278,7 @@ yuv2gbrp16_full_X_c(SwsContext *c, const int16_t *lumFilter,
             A = -0x40000000;
 
             for (j = 0; j < lumFilterSize; j++)
-                A += alpSrc[j][i] * lumFilter[j];
+                A += alpSrc[j][i] * (unsigned)lumFilter[j];
 
             A >>= 1;
             A += 0x20002000;



More information about the ffmpeg-cvslog mailing list