summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.com>2013-07-02 16:04:45 -0300
committerThiago Santos <thiago.sousa.santos@collabora.com>2013-07-03 10:23:45 -0300
commit0a88daaf8e51fb3f6eafc0cb33a628f58ab65805 (patch)
tree7e7ab3722fc98079058057b0c3a4b6cdd4dda6c6 /ext
parentb99a91deedfe8391b8b4a69487c65ad9083acb32 (diff)
dashdemux: protect against failed header downloads
Avoids criticals when downloaded fragment is NULL
Diffstat (limited to 'ext')
-rw-r--r--ext/dash/gstdashdemux.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ext/dash/gstdashdemux.c b/ext/dash/gstdashdemux.c
index b8a54329c..746ee88c2 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;
}