After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776376 - resindvd, uvch264src, dx9screencapsrc: fix clock ref leaks in error paths
resindvd, uvch264src, dx9screencapsrc: fix clock ref leaks in error paths
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
1.9.1
Other Linux
: Normal normal
: 1.14.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-22 06:44 UTC by Garima
Modified: 2018-04-16 08:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix memory leaks in usage of gst_element_get_clock API (2.70 KB, patch)
2016-12-22 06:44 UTC, Garima
none Details | Review
Fix memory leaks in usage of gst_element_get_clock API (2.72 KB, patch)
2016-12-27 05:54 UTC, Garima
committed Details | Review

Description Garima 2016-12-22 06:44:09 UTC
Created attachment 342370 [details] [review]
Fix memory leaks in usage of gst_element_get_clock API

Fix memory leaks in usage of gst_element_get_clock API.

gst_element_get_clock() API returns the GstClock of the element which need to be unref after the usage.

Fixes applied in following files:
ext/resindvd/rsninputselector.c
sys/uvch264/gstuvch264_src.c 
sys/winscreencap/gstdx9screencapsrc.c

Please check the attached patch file.
Comment 1 Sebastian Dröge (slomo) 2016-12-22 11:09:31 UTC
Review of attachment 342370 [details] [review]:

::: sys/winscreencap/gstdx9screencapsrc.c
@@ +518,3 @@
       GST_OBJECT_UNLOCK (src);
+      if (clock != NULL)
+        gst_object_unref (clock);

The code using the clock here seems generally broken. The "if (frame_number != -1 && frame_number == src->frame_number)" assumes that clock != NULL although the code above it handles the other case too.

Please fix that while you're at it.


Apart from that all these changes look ok
Comment 2 Garima 2016-12-27 05:54:32 UTC
Created attachment 342486 [details] [review]
Fix memory leaks in usage of gst_element_get_clock API

Please find the attached modified patch.
Comment 3 Tim-Philipp Müller 2016-12-31 11:29:35 UTC
Patch was updated (but not sure I understand what else should be done according to comment #1).
Comment 4 Tim-Philipp Müller 2018-04-12 18:13:27 UTC
The other thing will just have to be fixed when someone runs into it.

commit 8e6375c08b2a41760d51b132486f3988e71e36b3 
Author: Garima Gaur <garima.g@samsung.com>
Date:   Tue Dec 27 11:14:00 2016 +0530

    resindvd, uvch264src, dx9screencapsrc: fix clock ref leaks in error paths
    
    https://bugzilla.gnome.org/show_bug.cgi?id=776376