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
@ -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);
|
static GDateTime *gst_dash_demux_get_server_now_utc (GstDashDemux * demux);
|
||||||
|
|
||||||
#define SIDX(s) (&(s)->sidx_parser.sidx)
|
#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)
|
#define SIDX_CURRENT_ENTRY(s) SIDX_ENTRY(s, SIDX(s)->entry_index)
|
||||||
|
|
||||||
static void gst_dash_demux_send_content_protection_event (gpointer cp_data,
|
static void gst_dash_demux_send_content_protection_event (gpointer cp_data,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user