video-blend: fix memory leak when called with invalid parameters
authorMiguel Angel Cabrera Moya <madmac2501@gmail.com>
Fri, 2 Nov 2012 19:09:21 +0000 (20:09 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 2 Nov 2012 19:37:26 +0000 (19:37 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=687472

gst-libs/gst/video/video-blend.c

index 5816183..cd059a4 100644 (file)
@@ -164,11 +164,13 @@ gst_video_blend_scale_linear_RGBA (GstVideoInfo * src, GstBuffer * src_buffer,
   guint dest_stride;
   guint src_stride;
   guint8 *dest_pixels;
-  guint8 *tmpbuf = g_malloc (dest_width * 8 * 4);
+  guint8 *tmpbuf;
   GstVideoFrame src_frame, dest_frame;
 
   g_return_if_fail (dest_buffer != NULL);
 
+  tmpbuf = g_malloc (dest_width * 8 * 4);
+
   gst_video_info_init (dest);
   gst_video_info_set_format (dest, GST_VIDEO_INFO_FORMAT (src),
       dest_width, dest_height);