From ed8504e5906f9420999dc02b31d18e0be47ea557 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 19 Jul 2012 13:33:22 +0100 Subject: [PATCH] video-overlay-composition: fix GSlice alloc/free size mismatch Fix copy'n'paste bug which made us allocate a slice of the size of a rectangle for the overlay composition, but then free it passing the size of an overlay composition, which is not something GSlice takes to kindly, resulting in scary aborts like: ***MEMORY-ERROR***: GSlice: assertion failed: sinfo->n_allocated > 0 Also, g_slice_new already includes a cast, so remove our own casts, without which the compiler would probably have told us about this ages ago. https://bugzilla.gnome.org/show_bug.cgi?id=680091 --- gst-libs/gst/video/video-overlay-composition.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/video/video-overlay-composition.c b/gst-libs/gst/video/video-overlay-composition.c index f153e0c..d2e37cc 100644 --- a/gst-libs/gst/video/video-overlay-composition.c +++ b/gst-libs/gst/video/video-overlay-composition.c @@ -327,7 +327,7 @@ gst_video_overlay_composition_new (GstVideoOverlayRectangle * rectangle) * an empty new + _add() in a loop is easier? */ g_return_val_if_fail (GST_IS_VIDEO_OVERLAY_RECTANGLE (rectangle), NULL); - comp = (GstVideoOverlayComposition *) g_slice_new0 (GstVideoOverlayRectangle); + comp = g_slice_new0 (GstVideoOverlayComposition); gst_mini_object_init (GST_MINI_OBJECT_CAST (comp), 0, GST_TYPE_VIDEO_OVERLAY_COMPOSITION, @@ -694,7 +694,7 @@ gst_video_overlay_rectangle_new_argb (GstBuffer * pixels, g_return_val_if_fail (gst_buffer_get_size (pixels) >= height * width, NULL); g_return_val_if_fail (height > 0 && width > 0, NULL); - rect = (GstVideoOverlayRectangle *) g_slice_new0 (GstVideoOverlayRectangle); + rect = g_slice_new0 (GstVideoOverlayRectangle); gst_mini_object_init (GST_MINI_OBJECT_CAST (rect), 0, GST_TYPE_VIDEO_OVERLAY_RECTANGLE, -- 2.7.4