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
This commit is contained in:
Tim-Philipp Müller 2012-07-19 13:33:22 +01:00
parent 9eb8b64bb0
commit ed8504e590

View file

@ -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,