From: Tim-Philipp Müller Date: Thu, 19 Jul 2012 12:33:22 +0000 (+0100) Subject: video-overlay-composition: fix GSlice alloc/free size mismatch X-Git-Tag: 1.19.3~511^2~6169 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ed8504e5906f9420999dc02b31d18e0be47ea557;p=platform%2Fupstream%2Fgstreamer.git 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 --- 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,