mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-24 09:34:25 +00:00
dashdemux: Add assertion for preventing of access after the end of the sidx entries array
Better crash cleanly here than reading some random numbers from memory.
This commit is contained in:
parent
1586357a2f
commit
0dcb1e4ecc
1 changed files with 8 additions and 1 deletions
|
@ -292,7 +292,14 @@ static GTimeSpan gst_dash_demux_get_clock_compensation (GstDashDemux * demux);
|
|||
static GDateTime *gst_dash_demux_get_server_now_utc (GstDashDemux * demux);
|
||||
|
||||
#define SIDX(s) (&(s)->sidx_parser.sidx)
|
||||
#define SIDX_ENTRY(s,i) (&(SIDX(s)->entries[(i)]))
|
||||
|
||||
static inline GstSidxBoxEntry *
|
||||
SIDX_ENTRY (GstDashDemuxStream * s, gint i)
|
||||
{
|
||||
g_assert (i < SIDX (s)->entries_count);
|
||||
return &(SIDX (s)->entries[(i)]);
|
||||
}
|
||||
|
||||
#define SIDX_CURRENT_ENTRY(s) SIDX_ENTRY(s, SIDX(s)->entry_index)
|
||||
|
||||
static void gst_dash_demux_send_content_protection_event (gpointer cp_data,
|
||||
|
|
Loading…
Reference in a new issue