mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 04:01:08 +00:00
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:
parent
499736b709
commit
93b60df9ac
1 changed files with 8 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue