[FFmpeg-devel] [PATCH 3/5] swscale/utils: Fix xInc overflow

Michael Niedermayer michael at niedermayer.cc
Thu Apr 4 01:51:32 EEST 2024


Fixes: signed integer overflow: 2 * 1073741824 cannot be represented in type 'int'
Fixes: 67802/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-6249515855183872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libswscale/utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libswscale/utils.c b/libswscale/utils.c
index d34c8d1641e..df14eb016ce 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -593,7 +593,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
                 filter[i * filterSize + j] = coeff;
                 xx++;
             }
-            xDstInSrc += 2 * xInc;
+            xDstInSrc += 2LL * xInc;
         }
     }
 
-- 
2.17.1



More information about the ffmpeg-devel mailing list