[FFmpeg-cvslog] avformat/iamfdec: check nb_streams in header read

Michael Niedermayer git at videolan.org
Wed May 1 21:47:53 EEST 2024


ffmpeg | branch: release/7.0 | Michael Niedermayer <michael at niedermayer.cc> | Sat Apr 27 20:51:45 2024 +0200| [da8b2f9704438b80404a97e45015a3881452d6f5] | committer: James Almer

avformat/iamfdec: check nb_streams in header read

Fixes: Assertion pkt->stream_index < (unsigned)s->nb_streams && "Invalid stream index.\n" failed at libavformat/demux.c:572
Fixes: 67890/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-5166340789829632.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9f54c13bc4650c59fe2ffb04f5b85145f196fbb7)

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

 libavformat/iamfdec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/iamfdec.c b/libavformat/iamfdec.c
index e34d13e74c..ce6d4aa064 100644
--- a/libavformat/iamfdec.c
+++ b/libavformat/iamfdec.c
@@ -154,6 +154,9 @@ static int iamf_read_header(AVFormatContext *s)
         }
     }
 
+    if (!s->nb_streams)
+        return AVERROR_INVALIDDATA;
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list