From 96522f474cd9f574aa11f3aff61b66c7064be9f7 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Thu, 22 Nov 2012 12:28:20 -0300 Subject: [PATCH] mssdemux: mssmanifest: prevent accessing null stream fragment Move the access to the stream fragment data after the check if the fragment exists to prevent a segfault --- ext/smoothstreaming/gstmssmanifest.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/smoothstreaming/gstmssmanifest.c b/ext/smoothstreaming/gstmssmanifest.c index 8d92a0ddac..5d6dfa22cf 100644 --- a/ext/smoothstreaming/gstmssmanifest.c +++ b/ext/smoothstreaming/gstmssmanifest.c @@ -346,11 +346,13 @@ gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url) gchar *tmp; gchar *bitrate_str; gchar *start_time_str; - GstMssStreamFragment *fragment = stream->current_fragment->data; + GstMssStreamFragment *fragment; if (stream->current_fragment == NULL) /* stream is over */ return GST_FLOW_UNEXPECTED; + fragment = stream->current_fragment->data; + bitrate_str = (gchar *) xmlGetProp (stream->current_quality->data, (xmlChar *) MSS_PROP_BITRATE);