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
This commit is contained in:
Thiago Santos 2012-11-22 12:28:20 -03:00
parent ca4e5c34cb
commit 96522f474c

View file

@ -346,11 +346,13 @@ gst_mss_stream_get_fragment_url (GstMssStream * stream, gchar ** url)
gchar *tmp; gchar *tmp;
gchar *bitrate_str; gchar *bitrate_str;
gchar *start_time_str; gchar *start_time_str;
GstMssStreamFragment *fragment = stream->current_fragment->data; GstMssStreamFragment *fragment;
if (stream->current_fragment == NULL) /* stream is over */ if (stream->current_fragment == NULL) /* stream is over */
return GST_FLOW_UNEXPECTED; return GST_FLOW_UNEXPECTED;
fragment = stream->current_fragment->data;
bitrate_str = bitrate_str =
(gchar *) xmlGetProp (stream->current_quality->data, (gchar *) xmlGetProp (stream->current_quality->data,
(xmlChar *) MSS_PROP_BITRATE); (xmlChar *) MSS_PROP_BITRATE);