ffmpeg | branch: master | Michael Niedermayer <mich...@niedermayer.cc> | Thu Jun 19 23:26:47 2025 +0200| [38ead08815f803690d9e0484cd84eb01344ed0e9] | committer: Michael Niedermayer
swscale/output: Fix integer overflows in yuv2rgba64_1_c_template() Fixes: signed integer overflow: -132524 * 16525 cannot be represented in type 'int' Fixes: 414862270/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4869083202125824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=38ead08815f803690d9e0484cd84eb01344ed0e9 --- libswscale/output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index c37649e7ce..c18c96a57a 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1211,8 +1211,8 @@ yuv2rgba64_1_c_template(SwsInternal *c, const int32_t *buf0, for (i = 0; i < ((dstW + 1) >> 1); i++) { SUINT Y1 = (buf0[i * 2] ) >> 2; SUINT Y2 = (buf0[i * 2 + 1]) >> 2; - int U = (ubuf0[i] - (128 << 11)) >> 2; - int V = (vbuf0[i] - (128 << 11)) >> 2; + SUINT U = (ubuf0[i] - (128 << 11)) >> 2; + SUINT V = (vbuf0[i] - (128 << 11)) >> 2; int R, G, B; Y1 -= c->yuv2rgb_y_offset; @@ -1260,8 +1260,8 @@ yuv2rgba64_1_c_template(SwsInternal *c, const int32_t *buf0, for (i = 0; i < ((dstW + 1) >> 1); i++) { SUINT Y1 = (buf0[i * 2] ) >> 2; SUINT Y2 = (buf0[i * 2 + 1]) >> 2; - int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14; - int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14; + SUINT U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14; + SUINT V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14; int R, G, B; Y1 -= c->yuv2rgb_y_offset; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".