Skip to content

Commit 23592f9

Browse files
committed
swscale/output: fix integer overflow in yuv2rgba64_full_1_c_template()
Fixes: signed integer overflow: -293650 * 16525 cannot be represented in type 'int' Fixes: 408304111/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4762210299871232 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]>
1 parent 05f8c8c commit 23592f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libswscale/output.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,8 +1435,8 @@ yuv2rgba64_full_1_c_template(SwsInternal *c, const int32_t *buf0,
14351435
if (uvalpha == 0) {
14361436
for (i = 0; i < dstW; i++) {
14371437
SUINT Y = (buf0[i]) >> 2;
1438-
int U = (ubuf0[i] - (128 << 11)) >> 2;
1439-
int V = (vbuf0[i] - (128 << 11)) >> 2;
1438+
SUINT U = (ubuf0[i] - (128 << 11)) >> 2;
1439+
SUINT V = (vbuf0[i] - (128 << 11)) >> 2;
14401440
int R, G, B;
14411441

14421442
Y -= c->yuv2rgb_y_offset;
@@ -1471,8 +1471,8 @@ yuv2rgba64_full_1_c_template(SwsInternal *c, const int32_t *buf0,
14711471

14721472
for (i = 0; i < dstW; i++) {
14731473
SUINT Y = (buf0[i] ) >> 2;
1474-
int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14;
1475-
int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14;
1474+
SUINT U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14;
1475+
SUINT V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14;
14761476
int R, G, B;
14771477

14781478
Y -= c->yuv2rgb_y_offset;

0 commit comments

Comments
 (0)