diff options
author | Hyunjun Ko <zzoon.ko@samsung.com> | 2015-07-07 10:46:48 +0900 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-07-07 13:40:17 +0300 |
commit | eaf4153668626752bad8a5e17e7cb6812d4c3bca (patch) | |
tree | 61cf60e2b19f0ae2339bce72447e30f49b3e9573 | |
parent | ee63702d619c92185a33d67e66351f8777998c81 (diff) |
meta: transform_func: return FALSE if not supported or failed
https://bugzilla.gnome.org/show_bug.cgi?id=751778
-rw-r--r-- | gst/gstbuffer.c | 3 | ||||
-rw-r--r-- | libs/gst/net/gstnetaddressmeta.c | 7 | ||||
-rw-r--r-- | libs/gst/net/gstnetcontrolmessagemeta.c | 7 | ||||
-rw-r--r-- | tests/check/gst/gstmeta.c | 3 |
4 files changed, 16 insertions, 4 deletions
diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 56b190a4b..c1f0ebb91 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -2331,6 +2331,9 @@ _gst_parent_buffer_meta_transform (GstBuffer * dest, GstMeta * meta, GST_CAT_DEBUG (gst_parent_buffer_meta_debug, "copy buffer reference metadata"); + } else { + /* return FALSE, if transform type is not supported */ + return FALSE; } return TRUE; } diff --git a/libs/gst/net/gstnetaddressmeta.c b/libs/gst/net/gstnetaddressmeta.c index 9c970ba33..c4cdd4d17 100644 --- a/libs/gst/net/gstnetaddressmeta.c +++ b/libs/gst/net/gstnetaddressmeta.c @@ -44,10 +44,13 @@ static gboolean net_address_meta_transform (GstBuffer * transbuf, GstMeta * meta, GstBuffer * buffer, GQuark type, gpointer data) { - GstNetAddressMeta *nmeta = (GstNetAddressMeta *) meta; + GstNetAddressMeta *smeta, *dmeta; + smeta = (GstNetAddressMeta *) meta; /* we always copy no matter what transform */ - gst_buffer_add_net_address_meta (transbuf, nmeta->addr); + dmeta = gst_buffer_add_net_address_meta (transbuf, smeta->addr); + if (!dmeta) + return FALSE; return TRUE; } diff --git a/libs/gst/net/gstnetcontrolmessagemeta.c b/libs/gst/net/gstnetcontrolmessagemeta.c index fca39b545..ff9b8084a 100644 --- a/libs/gst/net/gstnetcontrolmessagemeta.c +++ b/libs/gst/net/gstnetcontrolmessagemeta.c @@ -47,10 +47,13 @@ static gboolean net_control_message_meta_transform (GstBuffer * transbuf, GstMeta * meta, GstBuffer * buffer, GQuark type, gpointer data) { - GstNetControlMessageMeta *nmeta = (GstNetControlMessageMeta *) meta; + GstNetControlMessageMeta *smeta, *dmeta; + smeta = (GstNetControlMessageMeta *) meta; /* we always copy no matter what transform */ - gst_buffer_add_net_control_message_meta (transbuf, nmeta->message); + dmeta = gst_buffer_add_net_control_message_meta (transbuf, smeta->message); + if (!dmeta) + return FALSE; return TRUE; } diff --git a/tests/check/gst/gstmeta.c b/tests/check/gst/gstmeta.c index 0cb034fcf..88205fc7c 100644 --- a/tests/check/gst/gstmeta.c +++ b/tests/check/gst/gstmeta.c @@ -117,6 +117,9 @@ test_transform_func (GstBuffer * transbuf, GstMeta * meta, test->duration = -1; } test->clock_rate = tmeta->clock_rate; + } else { + /* return FALSE, if transform type is not supported */ + return FALSE; } return TRUE; } |