[FFmpeg-cvslog] avformat/icodec: fix integer overflow with nb_pal
Michael Niedermayer
git at videolan.org
Sun Jan 5 01:30:09 EET 2025
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov 3 11:07:27 2024 +0100| [deecfb797bfdebcaa28e5bd8044cf378f06e781c] | committer: Michael Niedermayer
avformat/icodec: fix integer overflow with nb_pal
Fixes: runtime error: signed integer overflow
Fixes: 42536949/clusterfuzz-testcase-minimized-fuzzer_loadfile-6199846684393472
Found-by: ossfuzz
Reported-by: Kacper Michajlow
Tested-by: Kacper Michajlow
Reviewed-by: Peter Ross <pross at xvid.org>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 84569b6c22cb4eda9c682aabeb5f658112126780)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=deecfb797bfdebcaa28e5bd8044cf378f06e781c
---
libavformat/icodec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/icodec.c b/libavformat/icodec.c
index ec58abe343..765020f5df 100644
--- a/libavformat/icodec.c
+++ b/libavformat/icodec.c
@@ -172,7 +172,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt)
AV_WL32(buf + 32, image->nb_pal);
}
- if (image->nb_pal > INT_MAX / 4 - 14 - 40)
+ if (image->nb_pal > INT_MAX / 4 - 14 - 40U)
return AVERROR_INVALIDDATA;
AV_WL32(buf - 4, 14 + 40 + image->nb_pal * 4);
More information about the ffmpeg-cvslog
mailing list