Skip to content

Commit

Permalink
avformat/iamfdec: check nb_streams in header read
Browse files Browse the repository at this point in the history
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 9f54c13)
  • Loading branch information
michaelni authored and jamrial committed May 1, 2024
1 parent 1e6382a commit da8b2f9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libavformat/iamfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ static int iamf_read_header(AVFormatContext *s)
}
}

if (!s->nb_streams)
return AVERROR_INVALIDDATA;

return 0;
}

Expand Down

0 comments on commit da8b2f9

Please sign in to comment.