[FFmpeg-devel] [PATCH 1/3] avcodec/escape124: fix signdness of end of input check

Michael Niedermayer michael at niedermayer.cc
Mon Mar 6 01:36:52 EET 2023


Fixes: Timeout
Fixes: 56561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ESCAPE124_fuzzer-5560363635834880

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/escape124.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c
index 024eec59ce..e9c6b2df1b 100644
--- a/libavcodec/escape124.c
+++ b/libavcodec/escape124.c
@@ -89,7 +89,7 @@ static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
     unsigned i, j;
     CodeBook cb = { 0 };
 
-    if (size >= INT_MAX / 34 || get_bits_left(gb) < size * 34)
+    if (size >= INT_MAX / 34 || get_bits_left(gb) < (int)size * 34)
         return cb;
 
     if (size >= INT_MAX / sizeof(MacroBlock))
-- 
2.17.1



More information about the ffmpeg-devel mailing list