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 784932 - basesink: buffer leaks if preroll failed
basesink: buffer leaks if preroll failed
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal major
: 1.12.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-14 02:53 UTC by Jason Lin
Modified: 2017-07-14 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] basesink: fix buffer leaks if preroll failed (1.07 KB, patch)
2017-07-14 02:53 UTC, Jason Lin
committed Details | Review

Description Jason Lin 2017-07-14 02:53:50 UTC
Created attachment 355564 [details] [review]
[PATCH] basesink: fix buffer leaks if preroll failed

In gst_base_sink_chain_unlocked, it is supposed to unref the obj when it's done.
When 'gst_base_sink_do_preroll' returns error and goes to 'preroll_failed', the object is not unreferenced.

Problem:
video freeze after "pause -> 1/2 FF -> resume -> pause -> 1/2 FF ..." repeatedly

--- a/libs/gst/base/gstbasesink.c
+++ b/libs/gst/base/gstbasesink.c
@@ -3657,6 +3657,7 @@ dropped:
 preroll_failed:
   {
     GST_DEBUG_OBJECT (basesink, "preroll failed: %s", gst_flow_get_name (ret));
+    gst_mini_object_unref (GST_MINI_OBJECT_CAST (obj));
     return ret;
   }
 }
Comment 1 Matthew Waters (ystreet00) 2017-07-14 04:16:14 UTC
Thanks!

commit 5bd4603ed3923e8fa8e81ed0230a0fa219b191b2
Author: Jason Lin <shangchieh@realtek.com>
Date:   Thu Jul 13 21:52:34 2017 +0800

    basesink: fix buffer leaks if preroll failed
    
    buffer is not unreferened if preroll failed
    
    :Detailed Notes:
    - Problem : video freeze when switching from pause to 1/2-FF repeatedly
    - RootCause : buffer leaks in basesink
    - Solution : unref the buffer if prerolled failed
    
    :Testing Preformed:
    How to Test :
    pause -> 1/2 FF -> resume -> pause -> 1/2 FF ...
    
    https://bugzilla.gnome.org/show_bug.cgi?id=784932
Comment 2 Matthew Waters (ystreet00) 2017-07-14 07:41:41 UTC
and 1.12 d7c47d1562b5c86c194f830f50d5a7893a446274