mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
oggdemux: reject opus streams with negative start time
This is used by Vorbis for sample accurate clipping, but this is deemed an invalid stream by the opus spec.
This commit is contained in:
parent
ba967d285a
commit
e126073489
1 changed files with 9 additions and 3 deletions
|
@ -922,10 +922,16 @@ gst_ogg_pad_submit_packet (GstOggPad * pad, ogg_packet * packet)
|
|||
return GST_FLOW_ERROR;
|
||||
}
|
||||
|
||||
if (granule > pad->map.accumulated_granule)
|
||||
if (granule >= pad->map.accumulated_granule)
|
||||
start_granule = granule - pad->map.accumulated_granule;
|
||||
else
|
||||
start_granule = 0;
|
||||
else {
|
||||
if (pad->map.forbid_start_clamping) {
|
||||
GST_ERROR_OBJECT (ogg, "Start of stream maps to negative time");
|
||||
return GST_FLOW_ERROR;
|
||||
} else {
|
||||
start_granule = 0;
|
||||
}
|
||||
}
|
||||
|
||||
pad->start_time = gst_ogg_stream_granule_to_time (&pad->map,
|
||||
start_granule);
|
||||
|
|
Loading…
Reference in a new issue