mssdemux: fix segfault when trying to access codec_data

Check if codec_data was obtained before trying to use it to
prevent a segfault
This commit is contained in:
Thiago Santos 2013-12-17 17:55:58 -03:00
parent 5948a07324
commit 628461b4d1

View file

@ -627,6 +627,8 @@ _gst_mss_stream_audio_caps_from_qualitylevel_xml (GstMssStreamQuality * q)
if (!codec_data) {
gint codec_data_len;
codec_data_str = (gchar *) xmlGetProp (node, (xmlChar *) "WaveFormatEx");
if (codec_data_str != NULL) {
codec_data_len = strlen (codec_data_str) / 2;
/* a WAVEFORMATEX structure is 18 bytes */
@ -655,6 +657,7 @@ _gst_mss_stream_audio_caps_from_qualitylevel_xml (GstMssStreamQuality * q)
"but at least 18 bytes are expected", codec_data_len);
}
}
}
if (!codec_data && ((fourcc && strcmp (fourcc, "AACL") == 0) || atag == 255)
&& rate && channels) {