compositor: Fix memory leak when no buffer is available for a pad currently
authorSebastian Dröge <sebastian@centricular.com>
Thu, 18 Dec 2014 10:48:37 +0000 (11:48 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Thu, 18 Dec 2014 10:49:09 +0000 (11:49 +0100)
CID 1258718

gst/compositor/compositor.c

index c5d0901..06d96bf 100644 (file)
@@ -276,13 +276,15 @@ gst_compositor_pad_prepare_frame (GstVideoAggregatorPad * pad,
   guint outsize;
   GstVideoFrame *converted_frame;
   GstBuffer *converted_buf = NULL;
-  GstVideoFrame *frame = g_slice_new0 (GstVideoFrame);
+  GstVideoFrame *frame;
   static GstAllocationParams params = { 0, 15, 0, 0, };
   gint width, height;
 
   if (!pad->buffer)
     return TRUE;
 
+  frame = g_slice_new0 (GstVideoFrame);
+
   if (!gst_video_frame_map (frame, &pad->buffer_vinfo, pad->buffer,
           GST_MAP_READ)) {
     GST_WARNING_OBJECT (vagg, "Could not map input buffer");