diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2017-03-14 19:27:45 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2017-03-15 13:27:23 +0200 |
commit | 0dcb1e4eccf83e3d71ea6e47daca81c2d8bf0d60 (patch) | |
tree | 695186dca42fca8b24dab4c58ea2c7809a00139f /ext/dash | |
parent | 1586357a2fa67e04f7cd9d98daf79194491a85fc (diff) | |
download | gstreamer-plugins-bad-0dcb1e4eccf83e3d71ea6e47daca81c2d8bf0d60.tar.gz |
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.
Diffstat (limited to 'ext/dash')
-rw-r--r-- | ext/dash/gstdashdemux.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index 0e88864f4..a178fd636 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -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, |