mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
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:
parent
e6736e9925
commit
a3656ba29b
5 changed files with 7 additions and 7 deletions
|
@ -1166,7 +1166,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
|
||||||
|
|
||||||
/* we only copy metadata when the subclass implemented a transform_meta
|
/* we only copy metadata when the subclass implemented a transform_meta
|
||||||
* function and when it returns %TRUE */
|
* function and when it returns %TRUE */
|
||||||
if (do_copy) {
|
if (do_copy && info->transform_func) {
|
||||||
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
||||||
GST_DEBUG_OBJECT (decoder, "copy metadata %s", g_type_name (info->api));
|
GST_DEBUG_OBJECT (decoder, "copy metadata %s", g_type_name (info->api));
|
||||||
/* simply copy then */
|
/* simply copy then */
|
||||||
|
|
|
@ -696,7 +696,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
|
||||||
|
|
||||||
/* we only copy metadata when the subclass implemented a transform_meta
|
/* we only copy metadata when the subclass implemented a transform_meta
|
||||||
* function and when it returns %TRUE */
|
* function and when it returns %TRUE */
|
||||||
if (do_copy) {
|
if (do_copy && info->transform_func) {
|
||||||
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
||||||
GST_DEBUG_OBJECT (encoder, "copy metadata %s", g_type_name (info->api));
|
GST_DEBUG_OBJECT (encoder, "copy metadata %s", g_type_name (info->api));
|
||||||
/* simply copy then */
|
/* simply copy then */
|
||||||
|
|
|
@ -492,9 +492,9 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
|
||||||
const GstMetaInfo *info = (*meta)->info;
|
const GstMetaInfo *info = (*meta)->info;
|
||||||
const gchar *const *tags = gst_meta_api_type_get_tags (info->api);
|
const gchar *const *tags = gst_meta_api_type_get_tags (info->api);
|
||||||
|
|
||||||
if (!tags || (g_strv_length ((gchar **) tags) == 1
|
if (info->transform_func && (!tags || (g_strv_length ((gchar **) tags) == 1
|
||||||
&& gst_meta_api_type_has_tag (info->api,
|
&& gst_meta_api_type_has_tag (info->api,
|
||||||
g_quark_from_string (GST_META_TAG_AUDIO_STR)))) {
|
g_quark_from_string (GST_META_TAG_AUDIO_STR))))) {
|
||||||
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
||||||
GST_DEBUG_OBJECT (pay, "copy metadata %s", g_type_name (info->api));
|
GST_DEBUG_OBJECT (pay, "copy metadata %s", g_type_name (info->api));
|
||||||
/* simply copy then */
|
/* simply copy then */
|
||||||
|
|
|
@ -2932,7 +2932,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
|
||||||
|
|
||||||
/* we only copy metadata when the subclass implemented a transform_meta
|
/* we only copy metadata when the subclass implemented a transform_meta
|
||||||
* function and when it returns %TRUE */
|
* function and when it returns %TRUE */
|
||||||
if (do_copy) {
|
if (do_copy && info->transform_func) {
|
||||||
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
||||||
GST_DEBUG_OBJECT (decoder, "copy metadata %s", g_type_name (info->api));
|
GST_DEBUG_OBJECT (decoder, "copy metadata %s", g_type_name (info->api));
|
||||||
/* simply copy then */
|
/* simply copy then */
|
||||||
|
|
|
@ -1892,7 +1892,7 @@ foreach_metadata (GstBuffer * inbuf, GstMeta ** meta, gpointer user_data)
|
||||||
|
|
||||||
/* we only copy metadata when the subclass implemented a transform_meta
|
/* we only copy metadata when the subclass implemented a transform_meta
|
||||||
* function and when it returns %TRUE */
|
* function and when it returns %TRUE */
|
||||||
if (do_copy) {
|
if (do_copy && info->transform_func) {
|
||||||
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
GstMetaTransformCopy copy_data = { FALSE, 0, -1 };
|
||||||
GST_DEBUG_OBJECT (encoder, "copy metadata %s", g_type_name (info->api));
|
GST_DEBUG_OBJECT (encoder, "copy metadata %s", g_type_name (info->api));
|
||||||
/* simply copy then */
|
/* simply copy then */
|
||||||
|
|
Loading…
Reference in a new issue