gloverlaycompositor: Don't leak caps feature

Only copy it if we really are going to modify and use it

CID #1439873

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/652>
This commit is contained in:
Edward Hervey 2020-05-05 17:17:57 +02:00 committed by Edward Hervey
parent 637bbac622
commit add3023f09

View file

@ -156,16 +156,13 @@ _oce_transform_internal_caps (GstGLFilter * filter,
for (i = 0; i < n; i++) {
GstCapsFeatures *feat = gst_caps_get_features (removed, i);
if (feat) {
if (feat && gst_caps_features_contains (feat,
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION)) {
feat = gst_caps_features_copy (feat);
if (gst_caps_features_contains (feat,
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION)) {
/* prefer the passthrough case */
gst_caps_features_remove (feat,
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION);
gst_caps_set_features (removed, i, feat);
}
/* prefer the passthrough case */
gst_caps_features_remove (feat,
GST_CAPS_FEATURE_META_GST_VIDEO_OVERLAY_COMPOSITION);
gst_caps_set_features (removed, i, feat);
}
}