diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2006-07-13 14:02:16 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2012-09-11 01:54:38 +0100 |
commit | 93b60df9ac6e6de1159b7c7cf16f1547c1931de5 (patch) | |
tree | 5d92ee8af3604fb483c7a948c60113a640c04398 /gst/gdp | |
parent | 499736b709b32decfe2454ae9219306b32ff624e (diff) |
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)
Diffstat (limited to 'gst/gdp')
-rw-r--r-- | gst/gdp/dataprotocol.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gst/gdp/dataprotocol.c b/gst/gdp/dataprotocol.c index 887b2eeb7..dd290cc01 100644 --- a/gst/gdp/dataprotocol.c +++ b/gst/gdp/dataprotocol.c @@ -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; } |