mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-20 07:16:55 +00:00
qtdemux: avoid crashing on dash streams
DASH/fragmented moov might have no samples as those are carried in moof fragments. Avoid crashing or failing the stream because of that.
This commit is contained in:
parent
67255c6b49
commit
fa103ca5ad
1 changed files with 6 additions and 4 deletions
|
@ -9053,14 +9053,16 @@ qtdemux_prepare_streams (GstQTDemux * qtdemux)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* parse the initial sample for use in setting the frame rate cap */
|
/* parse the initial sample for use in setting the frame rate cap */
|
||||||
while (sample_num == 0) {
|
while (sample_num == 0 && sample_num < stream->n_samples) {
|
||||||
if (!qtdemux_parse_samples (qtdemux, stream, sample_num))
|
if (!qtdemux_parse_samples (qtdemux, stream, sample_num))
|
||||||
break;
|
break;
|
||||||
++sample_num;
|
++sample_num;
|
||||||
}
|
}
|
||||||
stream->first_duration = stream->samples[0].duration;
|
if (stream->n_samples > 0 && stream->stbl_index > 0) {
|
||||||
GST_LOG_OBJECT (qtdemux, "stream %d first duration %u",
|
stream->first_duration = stream->samples[0].duration;
|
||||||
stream->track_id, stream->first_duration);
|
GST_LOG_OBJECT (qtdemux, "stream %d first duration %u",
|
||||||
|
stream->track_id, stream->first_duration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Reference in a new issue