X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fgrab-ximage.c;h=063e9e313dda407f1f4cddb30d56d68fb5887f22;hp=4fea33858b00f236d553597bc115f26fe7e8bb48;hb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;hpb=488f2fa8fbdbc77e91a70da2962d73af49e6cace diff --git a/hacks/glx/grab-ximage.c b/hacks/glx/grab-ximage.c index 4fea3385..063e9e31 100644 --- a/hacks/glx/grab-ximage.c +++ b/hacks/glx/grab-ximage.c @@ -1,5 +1,5 @@ /* grab-ximage.c --- grab the screen to an XImage for use with OpenGL. - * xscreensaver, Copyright (c) 2001-2006 Jamie Zawinski + * xscreensaver, Copyright (c) 2001-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -319,6 +319,9 @@ pixmap_to_gl_ximage (Screen *screen, Window window, Pixmap pixmap) XGetGeometry (dpy, pixmap, &root, &x, &y, &width, &height, &bw, &depth); } + if (width < 5 || height < 5) /* something's gone wrong somewhere... */ + return 0; + /* Convert the server-side Pixmap to a client-side GL-ordered XImage. */ # ifdef HAVE_XSHM_EXTENSION