[Bug 728502] ximagesrc has a serious shmem leak

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed May 21 07:38:17 PDT 2014


https://bugzilla.gnome.org/show_bug.cgi?id=728502
  GStreamer | gst-plugins-good | 1.2.4

--- Comment #10 from Alexander Shashkevych <alex at stunpix.com> 2014-05-21 14:38:14 UTC ---
Line after condition sets a new value for freed variable, so there is no double
freeing:

::: sys/ximage/gstximagesrc.c
@@ +458,3 @@
   while (ximagesrc->buffer_pool != NULL) {
+    if (ximage != NULL)
+      gst_ximage_buffer_free (ximage);
+
     ximage = ximagesrc->buffer_pool->data;

Anyway, your patch also fixes a leak, but on the other hand it changes pool's
behavior and brings less optimal memory usage. Once pipeline empties the pool,
plugin allocates new buffer. When all buffers returned back to plugin - they
are pooled. But there are no guaranties that pipeline will reuse all of them
again and when your fix reuses only first buffer (still holding the rest of
buffers in memory), we could get "hanged" buffers that never could be reused.

My fix doesn't change behavior of original code which supposes freeing of all
buffers from pool except the last.

Please take this in account when you'll decide which fix will be merged.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list