mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
dashdemux: Exception handle in _sidx_seek()
If target seek position is outside of the range of sidx entries, binary search returns NULL pointer. https://bugzilla.gnome.org/show_bug.cgi?id=776200
This commit is contained in:
parent
0dcb1e4ecc
commit
ad015ceef5
1 changed files with 9 additions and 1 deletions
|
@ -1270,7 +1270,15 @@ gst_dash_demux_stream_sidx_seek (GstDashDemuxStream * dashstream,
|
|||
sizeof (GstSidxBoxEntry),
|
||||
(GCompareDataFunc) gst_dash_demux_index_entry_search, mode, &ts, NULL);
|
||||
|
||||
idx = entry - sidx->entries;
|
||||
if (entry) {
|
||||
idx = entry - sidx->entries;
|
||||
} else if (mode == GST_SEARCH_MODE_BEFORE) {
|
||||
/* target ts is smaller than pts of the first entry */
|
||||
idx = 0;
|
||||
} else {
|
||||
/* target ts is larger than pts + duration of the last entry
|
||||
* idx = sidx->entries_count */
|
||||
}
|
||||
|
||||
/* FIXME in reverse mode, if we are exactly at a fragment start it makes more
|
||||
* sense to start from the end of the previous fragment */
|
||||
|
|
Loading…
Reference in a new issue