aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2024-05-21 01:35:08 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2024-05-28 03:48:06 +0200
commitbfc22f364d31d8f2dc2acae1bd03d5894a00b8c5 (patch)
treecaa87eefeae9f29f66de9e9a09ad49f7061071e5
parent3f9daf1c18c2f0fb9e6d0b94af8e92cafc0cf010 (diff)
downloadffmpeg-bfc22f364d31d8f2dc2acae1bd03d5894a00b8c5.tar.gz
swscale/yuv2rgb: Use 64bit for brightness computation
This will not overflow for normal values Fixes: CID1500280 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libswscale/yuv2rgb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
index 2b2358d2cc..c1d6236f37 100644
--- a/libswscale/yuv2rgb.c
+++ b/libswscale/yuv2rgb.c
@@ -830,7 +830,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
cbu = (cbu * contrast * saturation) >> 32;
cgu = (cgu * contrast * saturation) >> 32;
cgv = (cgv * contrast * saturation) >> 32;
- oy -= 256 * brightness;
+ oy -= 256LL * brightness;
c->uOffset = 0x0400040004000400LL;
c->vOffset = 0x0400040004000400LL;