gdp: fix failure to deserialize event packets with empty payload (only ev...

Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c:
(gst_dp_event_from_packet_1_0):
Fixes #347337: failure to deserialize event packets with
empty payload (only event type)
This commit is contained in:
Thomas Vander Stichele 2006-07-13 14:02:16 +00:00 committed by Tim-Philipp Müller
parent 499736b709
commit 93b60df9ac

View file

@ -659,15 +659,16 @@ gst_dp_event_from_packet_1_0 (guint header_length, const guint8 * header,
{
GstEvent *event = NULL;
GstEventType type;
gchar *string;
GstStructure *s;
gchar *string = NULL;
GstStructure *s = NULL;
type = GST_DP_HEADER_PAYLOAD_TYPE (header) - GST_DP_PAYLOAD_EVENT_NONE;
string = g_strndup ((gchar *) payload, GST_DP_HEADER_PAYLOAD_LENGTH (header));
s = gst_structure_from_string (string, NULL);
g_free (string);
if (!s)
return NULL;
if (payload) {
string =
g_strndup ((gchar *) payload, GST_DP_HEADER_PAYLOAD_LENGTH (header));
s = gst_structure_from_string (string, NULL);
g_free (string);
}
event = gst_event_new_custom (type, s);
return event;
}