Bug 1154045 - Don't leak temporary GStreamer caps. r=kinetik

This commit is contained in:
Ralph Giles 2015-04-13 14:08:00 -07:00
parent 5bfd3c615a
commit 650e5064df

View File

@ -279,7 +279,11 @@ static bool SupportsCaps(GstElementFactory *aFactory, GstCaps *aCaps)
continue;
}
if (gst_caps_can_intersect(gst_static_caps_get(&templ->static_caps), aCaps)) {
bool supported = gst_caps_can_intersect(caps, aCaps);
gst_caps_unref(caps);
if (supported) {
return true;
}
}
@ -307,11 +311,11 @@ bool GStreamerFormatHelper::HaveElementsToProcessCaps(GstCaps* aCaps) {
}
}
gst_caps_unref(caps);
if (!found) {
return false;
}
gst_caps_unref(caps);
}
return true;