[FFmpeg-devel] [PATCH 3/3] avcodec/mpeg4videodec: more unsigned in amv computation
Michael Niedermayer
michael at niedermayer.cc
Fri Jun 2 01:26:01 EEST 2023
Fixes: signed integer overflow: -2147483648 + -1048576 cannot be represented in type 'int'
Fixes: 59365/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-642654923954585
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/mpeg4videodec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index d456e5dd11..72c8ad3048 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -861,7 +861,7 @@ static inline int get_amv(Mpeg4DecContext *ctx, int n)
for (y = 0; y < 16; y++) {
int v;
- v = mb_v + dy * y;
+ v = mb_v + (unsigned)dy * y;
// FIXME optimize
for (x = 0; x < 16; x++) {
sum += v >> shift;
--
2.17.1
More information about the ffmpeg-devel
mailing list