vaapisink: fix memory leak of GstSample objects.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 12 Apr 2013 15:05:06 +0000 (17:05 +0200)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Fri, 12 Apr 2013 15:05:06 +0000 (17:05 +0200)
Fix memory leak of GstSample objects in GstVideoOverlayInterface::expose().
This also fixes extra unreferencing of the underlying GstBuffer in the common
path afterwards (for both 0.10 or 1.0).

gst/vaapi/gstvaapisink.c

index 6c0cf90b81a34923664e789041498b7ce02db2f7..2cde568b4bd35abf9e9d3e79f2c35d71714b5a1e 100644 (file)
@@ -225,7 +225,8 @@ gst_vaapisink_video_overlay_expose(GstVideoOverlay *overlay)
     GstSample * const sample = gst_base_sink_get_last_sample(base_sink);
     if (!sample)
         return;
-    buffer = gst_sample_get_buffer(sample);
+    buffer = gst_buffer_ref(gst_sample_get_buffer(sample));
+    gst_sample_unref(sample);
 #else
     buffer = gst_base_sink_get_last_buffer(base_sink);
 #endif