X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=xscreensaver%2Fhacks%2Fglx%2Fgrab-ximage.c;h=653fe4ba9a322ce33d1ee884ee3e4479e9e61c3d;hb=90e8b35820a6f805af8fb9bcb5e662cf83ef8883;hp=063e9e313dda407f1f4cddb30d56d68fb5887f22;hpb=bb98064443c0c255d8b233389aed1aa1410e378e;p=xscreensaver diff --git a/xscreensaver/hacks/glx/grab-ximage.c b/xscreensaver/hacks/glx/grab-ximage.c index 063e9e3..653fe4b 100644 --- a/xscreensaver/hacks/glx/grab-ximage.c +++ b/xscreensaver/hacks/glx/grab-ximage.c @@ -141,11 +141,10 @@ convert_ximage_to_rgba32 (Screen *screen, XImage *image) unsigned int srpos=0, sgpos=0, sbpos=0; unsigned int srmsk=0, sgmsk=0, sbmsk=0; unsigned int srsiz=0, sgsiz=0, sbsiz=0; - int i; XColor *colors = 0; unsigned char spread_map[3][256]; - /* Note: height+2 in "to" to be to work around an array bounds overrun + /* Note: height+2 in "to" to work around an array bounds overrun in gluBuild2DMipmaps / gluScaleImage. */ XImage *from = image; @@ -193,6 +192,7 @@ convert_ximage_to_rgba32 (Screen *screen, XImage *image) if (colors == 0) /* truecolor */ { + int i; for (i = 0; i < 256; i++) { spread_map[0][i] = spread_bits (i, srsiz); @@ -201,6 +201,10 @@ convert_ximage_to_rgba32 (Screen *screen, XImage *image) } } + /* trying to track down an intermittent crash in ximage_putpixel_32 */ + if (to->width < from->width) abort(); + if (to->height < from->height) abort(); + for (y = 0; y < from->height; y++) for (x = 0; x < from->width; x++) {