diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2020-07-09 12:07:28 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-09 13:37:20 +0200 |
commit | 4646f94b9cc83facb651a4540f342014cb75f937 (patch) | |
tree | e1934abb0c8cd6fd38391fbe62673787c61d937e /libavformat/mm.c | |
parent | 14a4be8fb4800fbac9e3e9a884527a7b582591a1 (diff) | |
download | ffmpeg-4646f94b9cc83facb651a4540f342014cb75f937.tar.gz |
avformat/mm: Check for existence of audio stream
No audio stream is created unconditionally and if none has been created,
no packet with stream_index 1 may be returned. This fixes an assert in
ff_read_packet() in libavformat/utils reported in ticket #8782.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit ec59dc73f0cc8930bf5dae389cd76d049d537ca7)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavformat/mm.c')
-rw-r--r-- | libavformat/mm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mm.c b/libavformat/mm.c index 8a1382e03c..de5f9d6161 100644 --- a/libavformat/mm.c +++ b/libavformat/mm.c @@ -174,6 +174,8 @@ static int read_packet(AVFormatContext *s, return 0; case MM_TYPE_AUDIO : + if (s->nb_streams < 2) + return AVERROR_INVALIDDATA; if (av_get_packet(s->pb, pkt, length)<0) return AVERROR(ENOMEM); pkt->stream_index = 1; |