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@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-04-27 20:51:45 +02:00
parent 20a6bfda0f
commit 9f54c13bc4
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64

View File

@ -154,6 +154,9 @@ static int iamf_read_header(AVFormatContext *s)
}
}
if (!s->nb_streams)
return AVERROR_INVALIDDATA;
return 0;
}