diff mbox series

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

Message ID 20200216194303.819-4-michael@niedermayer.cc
State New
Headers show
Series [FFmpeg-devel,1/4] avformat/swfenc: Fix integer overflow in frame rate handling
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Michael Niedermayer Feb. 16, 2020, 7:43 p.m. UTC
Fixes: signed integer overflow: 524280 * 4432 cannot be represented in type 'int'
Fixes: ticket8322

Found-by: Suhwan
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libswscale/output.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libswscale/output.c b/libswscale/output.c
index 04595d2d01..68f43ffba3 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;