[FFmpeg-cvslog] avformat/aiffdec: avoid integer overflow in get_meta()

Michael Niedermayer git at videolan.org
Mon Oct 10 16:55:59 EEST 2022


ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Wed Mar 23 01:08:56 2022 +0100| [4d7a4f66f8bb3c8ec3c11388fd60bdf874d66df2] | committer: Michael Niedermayer

avformat/aiffdec: avoid integer overflow in get_meta()

Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 45891/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6159183893889024

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 6a02de21278ec3bea1d2c62665f2629d5a62210f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4d7a4f66f8bb3c8ec3c11388fd60bdf874d66df2
---

 libavformat/aiffdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 1040f3257d..9e56d80156 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -73,7 +73,7 @@ static int get_tag(AVIOContext *pb, uint32_t * tag)
 /* Metadata string read */
 static void get_meta(AVFormatContext *s, const char *key, int size)
 {
-    uint8_t *str = av_malloc(size+1);
+    uint8_t *str = av_malloc(size+1U);
 
     if (str) {
         int res = avio_read(s->pb, str, size);



More information about the ffmpeg-cvslog mailing list