[FFmpeg-cvslog] avformat/aiffdec: Check packet size

Michael Niedermayer git at videolan.org
Thu Nov 5 01:22:49 EET 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon Oct 26 20:55:31 2020 +0100| [0ba71a72d3a617b255b71988a000d5093222f779] | committer: Michael Niedermayer

avformat/aiffdec: Check packet size

Fixes: Fixes infinite loop
Fixes: 26575/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5727522236661760

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/aiffdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index c650e9074d..15733478e1 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -406,6 +406,8 @@ static int aiff_read_packet(AVFormatContext *s,
         break;
     default:
         size = st->codecpar->block_align ? (MAX_SIZE / st->codecpar->block_align) * st->codecpar->block_align : MAX_SIZE;
+        if (!size)
+            return AVERROR_INVALIDDATA;
     }
     size = FFMIN(max_size, size);
     res = av_get_packet(s->pb, pkt, size);



More information about the ffmpeg-cvslog mailing list