From 0a88daaf8e51fb3f6eafc0cb33a628f58ab65805 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Tue, 2 Jul 2013 16:04:45 -0300 Subject: [PATCH] dashdemux: protect against failed header downloads Avoids criticals when downloaded fragment is NULL --- ext/dash/gstdashdemux.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c index b8a54329cc..746ee88c24 100644 --- a/ext/dash/gstdashdemux.c +++ b/ext/dash/gstdashdemux.c @@ -1690,7 +1690,7 @@ static GstBuffer * gst_dash_demux_download_header_fragment (GstDashDemux * demux, guint stream_idx, gchar * path, gint64 range_start, gint64 range_end) { - GstBuffer *buffer; + GstBuffer *buffer = NULL; gchar *next_header_uri; GstFragment *fragment; @@ -1706,8 +1706,10 @@ gst_dash_demux_download_header_fragment (GstDashDemux * demux, guint stream_idx, fragment = gst_uri_downloader_fetch_uri_with_range (demux->downloader, next_header_uri, range_start, range_end); g_free (next_header_uri); - buffer = gst_fragment_get_buffer (fragment); - g_object_unref (fragment); + if (fragment) { + buffer = gst_fragment_get_buffer (fragment); + g_object_unref (fragment); + } return buffer; }