Index: sys/xvimage/xvimagesink.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins/sys/xvimage/Attic/xvimagesink.c,v
retrieving revision 1.100.2.8
diff -u -r1.100.2.8 xvimagesink.c
--- sys/xvimage/xvimagesink.c	1 Jul 2005 17:31:36 -0000	1.100.2.8
+++ sys/xvimage/xvimagesink.c	5 Sep 2005 20:36:19 -0000
@@ -1574,7 +1574,8 @@
       /* We check for geometry or image format changes */
       if ((xvimage->width != xvimagesink->video_width) ||
           (xvimage->height != xvimagesink->video_height) ||
-          (xvimage->im_format != xvimagesink->xcontext->im_format)) {
+          (xvimage->im_format != xvimagesink->xcontext->im_format) ||
+	  (xvimage->size < size)) {
         /* This image is unusable. Destroying... */
         gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
         xvimage = NULL;
@@ -1592,6 +1593,12 @@
     xvimage =
         gst_xvimagesink_xvimage_new (xvimagesink, xvimagesink->video_width,
         xvimagesink->video_height);
+    if (xvimage && xvimage->size < size) {
+      g_warning ("gst_xvimagesink_xvimage_new failed to create image "
+	      "of suitable size (Wanted %u, got %u)", size, xvimage->size);
+      gst_xvimagesink_xvimage_destroy (xvimagesink, xvimage);
+      xvimage = NULL;
+    }
   }
 
   if (xvimage) {
