diff mbox series

[FFmpeg-devel,1/4] avformat/iff: Check size before skip

Message ID 20201114222628.6486-1-michael@niedermayer.cc
State Accepted
Commit 8b50e8bc2975fad85e0713e05940ee9ecb5e8a18
Headers show
Series [FFmpeg-devel,1/4] avformat/iff: Check size before skip
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Michael Niedermayer Nov. 14, 2020, 10:26 p.m. UTC
Fixes: Infinite loop
Fixes: 27292/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5731168991051776

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/iff.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Nov. 21, 2020, 7:51 p.m. UTC | #1
On Sat, Nov 14, 2020 at 11:26:25PM +0100, Michael Niedermayer wrote:
> Fixes: Infinite loop
> Fixes: 27292/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5731168991051776
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/iff.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply patchset

[...]
diff mbox series

Patch

diff --git a/libavformat/iff.c b/libavformat/iff.c
index a70184f105..f017684620 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -259,6 +259,9 @@  static int parse_dsd_prop(AVFormatContext *s, AVStream *st, uint64_t eof)
         uint64_t size     = avio_rb64(pb);
         uint64_t orig_pos = avio_tell(pb);
 
+        if (size >= INT64_MAX)
+            return AVERROR_INVALIDDATA;
+
         switch(tag) {
         case MKTAG('A','B','S','S'):
             if (size < 8)