Title: [201272] releases/WebKitGTK/webkit-2.12/Source/WebCore
Revision
201272
Author
carlo...@webkit.org
Date
2016-05-23 04:15:45 -0700 (Mon, 23 May 2016)

Log Message

Merge r200811 - VideoSinkGStreamer: plug a GstBuffer leak in webkitVideoSinkRequestRender()
https://bugs.webkit.org/show_bug.cgi?id=157617

Reviewed by Darin Adler.

Unref the newly-created GstBuffer object after creating the new GstSample
that's based on it. gst_sample_new() doesn't take the ownership of it.

Also, don't unref the GstBuffer object that's passed in to the
webkitVideoSinkRequestRender() function in case the allocation of the
replacement buffer fails. We don't have any ownership over that buffer
and it's not unreffed anywhere else in this function.

* platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
(webkitVideoSinkRequestRender):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog (201271 => 201272)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-23 11:10:42 UTC (rev 201271)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/ChangeLog	2016-05-23 11:15:45 UTC (rev 201272)
@@ -1,3 +1,21 @@
+2016-05-12  Zan Dobersek  <zdober...@igalia.com>
+
+        VideoSinkGStreamer: plug a GstBuffer leak in webkitVideoSinkRequestRender()
+        https://bugs.webkit.org/show_bug.cgi?id=157617
+
+        Reviewed by Darin Adler.
+
+        Unref the newly-created GstBuffer object after creating the new GstSample
+        that's based on it. gst_sample_new() doesn't take the ownership of it.
+
+        Also, don't unref the GstBuffer object that's passed in to the
+        webkitVideoSinkRequestRender() function in case the allocation of the
+        replacement buffer fails. We don't have any ownership over that buffer
+        and it's not unreffed anywhere else in this function.
+
+        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
+        (webkitVideoSinkRequestRender):
+
 2016-05-11  Zalan Bujtas  <za...@apple.com>
 
         Absolute positioned element is not placed properly when parent becomes the containing block.

Modified: releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp (201271 => 201272)


--- releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp	2016-05-23 11:10:42 UTC (rev 201271)
+++ releases/WebKitGTK/webkit-2.12/Source/WebCore/platform/graphics/gstreamer/VideoSinkGStreamer.cpp	2016-05-23 11:15:45 UTC (rev 201272)
@@ -211,10 +211,8 @@
         GstBuffer* newBuffer = WebCore::createGstBuffer(buffer);
 
         // Check if allocation failed.
-        if (UNLIKELY(!newBuffer)) {
-            gst_buffer_unref(buffer);
+        if (UNLIKELY(!newBuffer))
             return nullptr;
-        }
 
         // We don't use Color::premultipliedARGBFromColor() here because
         // one function call per video pixel is just too expensive:
@@ -259,6 +257,7 @@
         gst_video_frame_unmap(&sourceFrame);
         gst_video_frame_unmap(&destinationFrame);
         sample = adoptGRef(gst_sample_new(newBuffer, priv->currentCaps, nullptr, nullptr));
+        gst_buffer_unref(newBuffer);
     }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to