diff options
author | Michael Smith <msmith@xiph.org> | 2006-04-28 13:40:15 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2012-09-11 01:54:38 +0100 |
commit | 1c7fae3d5d750ac326e864d23f47756949f16acb (patch) | |
tree | 5df8a0a8b58f2438ec02197d2db4cfaefe8b29e3 /gst/gdp | |
parent | cfcef37b4f787bf140733f149be449ac1d9deced (diff) | |
download | gstreamer-plugins-bad-1c7fae3d5d750ac326e864d23f47756949f16acb.tar.gz |
gdp: Fixes in reading/writing events over GDP (not currently used?) - dereferencing ...
Original commit message from CVS:
* libs/gst/dataprotocol/dataprotocol.c: (gst_dp_packet_from_event),
(gst_dp_event_from_packet):
Fixes in reading/writing events over GDP (not currently used?) -
dereferencing NULL events for unknown/invalid event types, memory
leak, and change g_warning to GST_WARNING.
Diffstat (limited to 'gst/gdp')
-rw-r--r-- | gst/gdp/dataprotocol.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gst/gdp/dataprotocol.c b/gst/gdp/dataprotocol.c index 9598321e4..4f909b138 100644 --- a/gst/gdp/dataprotocol.c +++ b/gst/gdp/dataprotocol.c @@ -319,7 +319,7 @@ gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags, /* first construct payload, since we need the length */ switch (GST_EVENT_TYPE (event)) { case GST_EVENT_UNKNOWN: - g_warning ("Unknown event, ignoring"); + GST_WARNING ("Unknown event, ignoring"); *length = 0; g_free (h); return FALSE; @@ -355,10 +355,12 @@ gst_dp_packet_from_event (const GstEvent * event, GstDPHeaderFlag flags, case GST_EVENT_QOS: case GST_EVENT_NAVIGATION: case GST_EVENT_TAG: - g_warning ("Unhandled event type %d, ignoring", GST_EVENT_TYPE (event)); + GST_WARNING ("Unhandled event type %d, ignoring", GST_EVENT_TYPE (event)); + *length = 0; + g_free (h); return FALSE; default: - g_warning ("Unknown event type %d, ignoring", GST_EVENT_TYPE (event)); + GST_WARNING ("Unknown event type %d, ignoring", GST_EVENT_TYPE (event)); *length = 0; g_free (h); return FALSE; @@ -486,7 +488,7 @@ gst_dp_event_from_packet (guint header_length, const guint8 * header, type = GST_DP_HEADER_PAYLOAD_TYPE (header) - GST_DP_PAYLOAD_EVENT_NONE; switch (type) { case GST_EVENT_UNKNOWN: - g_warning ("Unknown event, ignoring"); + GST_WARNING ("Unknown event, ignoring"); return FALSE; case GST_EVENT_EOS: case GST_EVENT_FLUSH_START: @@ -520,10 +522,10 @@ gst_dp_event_from_packet (guint header_length, const guint8 * header, case GST_EVENT_QOS: case GST_EVENT_NAVIGATION: case GST_EVENT_TAG: - g_warning ("Unhandled event type %d, ignoring", GST_EVENT_TYPE (event)); + GST_WARNING ("Unhandled event type %d, ignoring", type); return FALSE; default: - g_warning ("Unknown event type %d, ignoring", GST_EVENT_TYPE (event)); + GST_WARNING ("Unknown event type %d, ignoring", type); return FALSE; } |