mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
matroskademux: Avoid division by zero assert in gst_matroska_demux_search_pos
https://bugzilla.gnome.org/show_bug.cgi?id=711829
This commit is contained in:
parent
0ee332378b
commit
b3e0b1dbca
1 changed files with 10 additions and 5 deletions
|
@ -1872,12 +1872,17 @@ retry:
|
|||
GST_TIME_FORMAT, opos, GST_TIME_ARGS (otime),
|
||||
GST_TIME_ARGS (otime - demux->stream_start_time),
|
||||
GST_TIME_ARGS (demux->stream_start_time), GST_TIME_ARGS (time));
|
||||
newpos =
|
||||
gst_util_uint64_scale (opos - demux->common.ebml_segment_start,
|
||||
time - demux->stream_start_time,
|
||||
otime - demux->stream_start_time) - chunk;
|
||||
if (newpos < 0)
|
||||
|
||||
if (otime <= demux->stream_start_time) {
|
||||
newpos = 0;
|
||||
} else {
|
||||
newpos =
|
||||
gst_util_uint64_scale (opos - demux->common.ebml_segment_start,
|
||||
time - demux->stream_start_time,
|
||||
otime - demux->stream_start_time) - chunk;
|
||||
if (newpos < 0)
|
||||
newpos = 0;
|
||||
}
|
||||
/* favour undershoot */
|
||||
newpos = newpos * 90 / 100;
|
||||
newpos += demux->common.ebml_segment_start;
|
||||
|
|
Loading…
Reference in a new issue