Commit be84216c authored by Andreas Rheinhardt's avatar Andreas Rheinhardt

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: 's avatarMichael Niedermayer <michael@niedermayer.cc>
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
(cherry picked from commit ec59dc73f0cc8930bf5dae389cd76d049d537ca7)
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
parent 401b59e4
......@@ -175,6 +175,8 @@ static int read_packet(AVFormatContext *s,
return 0;
case MM_TYPE_AUDIO :
if (s->nb_streams < 2)
return AVERROR_INVALIDDATA;
if ((ret = av_get_packet(s->pb, pkt, length)) < 0)
return ret;
pkt->stream_index = 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment