+2006-03-05 Julien MOUTTE <julien@moutte.net>
+
+ * sys/xvimage/xvimagesink.c: (gst_xvimagesink_xvimage_new),
+ (gst_xvimagesink_show_frame), (gst_xvimagesink_buffer_alloc):
+ Check that the xvimage we are creating has a correct size
+ before returning it. (#314897)
+
2006-03-05 Tim-Philipp Müller <tim at centricular dot net>
* gst/typefind/gsttypefindfunctions.c: (plugin_init):
g_return_val_if_fail (GST_IS_XVIMAGESINK (xvimagesink), NULL);
-
xvimage = (GstXvImageBuffer *) gst_mini_object_new (GST_TYPE_XVIMAGE_BUFFER);
structure = gst_caps_get_structure (caps, 0);
xvimagesink->xvimage = gst_xvimagesink_xvimage_new (xvimagesink,
GST_BUFFER_CAPS (buf));
- if (!xvimagesink->xvimage)
+ if ((!xvimagesink->xvimage) ||
+ (xvimagesink->xvimage->size < GST_BUFFER_SIZE (buf)))
goto no_image;
}
/* We found no suitable image in the pool. Creating... */
GST_DEBUG_OBJECT (xvimagesink, "no usable image in pool, creating xvimage");
xvimage = gst_xvimagesink_xvimage_new (xvimagesink, intersection);
+ if (xvimage->size < size) {
+ /* This image is unusable. Destroying... */
+ gst_xvimage_buffer_free (xvimage);
+ xvimage = NULL;
+ }
}
if (xvimage) {