libs: Check if meta transform_func is NULL before using it

https://bugzilla.gnome.org/show_bug.cgi?id=782050
This commit is contained in:
Sebastian Dröge 2017-05-02 14:31:14 +03:00
parent e6736e9925
commit a3656ba29b
5 changed files with 7 additions and 7 deletions

View file

@ -1166,7 +1166,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
/* we only copy metadata when the subclass implemented a transform_meta
* function and when it returns %TRUE */
if (do_copy) {
if (do_copy && info->transform_func) {
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
GST_DEBUG_OBJECT (decoder, "copy metadata %s", g_type_name (info->api));
/* simply copy then */

View file

@ -696,7 +696,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
/* we only copy metadata when the subclass implemented a transform_meta
* function and when it returns %TRUE */
if (do_copy) {
if (do_copy && info->transform_func) {
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
GST_DEBUG_OBJECT (encoder, "copy metadata %s", g_type_name (info->api));
/* simply copy then */

View file

@ -492,9 +492,9 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
const GstMetaInfo *info = (*meta)->info;
const gchar *const *tags = gst_meta_api_type_get_tags (info->api);
if (!tags || (g_strv_length ((gchar **) tags) == 1
&& gst_meta_api_type_has_tag (info->api,
g_quark_from_string (GST_META_TAG_AUDIO_STR)))) {
if (info->transform_func && (!tags || (g_strv_length ((gchar **) tags) == 1
&& gst_meta_api_type_has_tag (info->api,
g_quark_from_string (GST_META_TAG_AUDIO_STR))))) {
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
GST_DEBUG_OBJECT (pay, "copy metadata %s", g_type_name (info->api));
/* simply copy then */

View file

@ -2932,7 +2932,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
/* we only copy metadata when the subclass implemented a transform_meta
* function and when it returns %TRUE */
if (do_copy) {
if (do_copy && info->transform_func) {
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
GST_DEBUG_OBJECT (decoder, "copy metadata %s", g_type_name (info->api));
/* simply copy then */

View file

@ -1892,7 +1892,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
/* we only copy metadata when the subclass implemented a transform_meta
* function and when it returns %TRUE */
if (do_copy) {
if (do_copy && info->transform_func) {
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
GST_DEBUG_OBJECT (encoder, "copy metadata %s", g_type_name (info->api));
/* simply copy then */