1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

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>
(cherry picked from commit 9f54c13bc4)
This commit is contained in:
Michael Niedermayer 2024-04-27 20:51:45 +02:00 committed by James Almer
parent 1e6382a6b7
commit da8b2f9704

View File

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