GNOME Bugzilla – Bug 773515
rtph263ppay: Fix caps leak
Last modified: 2016-11-04 17:39:51 UTC
Fix leaking caps when downstream has not-fixed caps.
Created attachment 338480 [details] [review] rtph263ppay: Fix caps leak
Review of attachment 338480 [details] [review]: ::: gst/rtp/gstrtph263ppay.c @@ +270,2 @@ caps = gst_pad_get_pad_template_caps (GST_RTP_BASE_PAYLOAD_SINKPAD (payload)); Shouldn't this return the intersection between the two then?
(In reply to Sebastian Dröge (slomo) from comment #2) > Shouldn't this return the intersection between the two then? Agree. The patch only plugs a leak, but I can craft a test case and update the patch fixing that behavior as well.
Taking a closer look at the code I think it works as intended. Intersect is wrong since we're checking the peercaps downstream (rtp-caps) and returning a h263-caps. If the rtp-caps is fixed there is logic for checking whether there are any fields of the rtp-caps that should be transferred to the returned h263-caps. There could potentially be a use case for checking this also when the rtp-caps is not fixed (and we enter the reviewed code path), but I propose we keep the logic as it's been for a long time instead of complicate things to support a made up use case. I propose to apply the patch as it is to fix the leak.
Attachment 338480 [details] pushed as 78ab8cb - rtph263ppay: Fix caps leak