A typo in a static caps string may result in failure to
deserialise it, so don't dereference the result without
checking.
break;
case PROP_CAPS:
GST_PAD_TEMPLATE_CAPS (object) = g_value_dup_boxed (value);
- /* GstPadTemplate are usually leaked so are their caps */
- GST_MINI_OBJECT_FLAG_SET (GST_PAD_TEMPLATE_CAPS (object),
- GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
+ if (GST_PAD_TEMPLATE_CAPS (object) != NULL) {
+ /* GstPadTemplate are usually leaked so are their caps */
+ GST_MINI_OBJECT_FLAG_SET (GST_PAD_TEMPLATE_CAPS (object),
+ GST_MINI_OBJECT_FLAG_MAY_BE_LEAKED);
+ }
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);