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)
release/7.0
Michael Niedermayer 10 months ago committed by James Almer
parent 1e6382a6b7
commit da8b2f9704
  1. 3
      libavformat/iamfdec.c

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

Loading…
Cancel
Save