This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch release/9.1
in repository ffmpeg.

commit 76226ce6966dfc3596389cdab2002ba5b8f7049c
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Mon Nov 16 06:56:47 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Thu Nov 19 14:55:53 2026 +0100

    swscale/output: avoid signed overflow in yuv2gbrpf32_full_X_c()
    
    The chroma products and the sums are computed like in yuv2gbrp16_full_X_c()
    
    Found during review of the fix for the OSS-Fuzz issue 574937224
    
    Signed-off-by: Michael Niedermayer <[email protected]>
    (cherry picked from commit 9e7f4fb97ea95142256b4c6dfa0e3b6588b6e0d8)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libswscale/output.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/libswscale/output.c b/libswscale/output.c
index 8a39f07cdc..d32ac8ce38 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -2588,13 +2588,13 @@ yuv2gbrpf32_full_X_c(SwsInternal *c, const int16_t 
*lumFilter,
         Y -= c->yuv2rgb_y_offset;
         Y *= c->yuv2rgb_y_coeff;
         Y += (1 << 13) - (1 << 29);
-        R = V * c->yuv2rgb_v2r_coeff;
-        G = V * c->yuv2rgb_v2g_coeff + U * c->yuv2rgb_u2g_coeff;
-        B =                            U * c->yuv2rgb_u2b_coeff;
+        R = V * (unsigned)c->yuv2rgb_v2r_coeff;
+        G = V * (unsigned)c->yuv2rgb_v2g_coeff + U * 
(unsigned)c->yuv2rgb_u2g_coeff;
+        B =                                      U * 
(unsigned)c->yuv2rgb_u2b_coeff;
 
-        R = av_clip_uintp2(((Y + R) >> 14) + (1<<15), 16);
-        G = av_clip_uintp2(((Y + G) >> 14) + (1<<15), 16);
-        B = av_clip_uintp2(((Y + B) >> 14) + (1<<15), 16);
+        R = av_clip_uintp2(((Y + (int64_t)R) >> 14) + (1<<15), 16);
+        G = av_clip_uintp2(((Y + (int64_t)G) >> 14) + (1<<15), 16);
+        B = av_clip_uintp2(((Y + (int64_t)B) >> 14) + (1<<15), 16);
 
         dest32[0][i] = av_float2int(float_mult * (float)G);
         dest32[1][i] = av_float2int(float_mult * (float)B);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to