X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fjigsaw.c;h=bdbe44684a79929531e4a8658e04342a276cd443;hp=afeefc86899b57462b8366590e9929d33e3fd919;hb=8eb2873d7054e705c4e83f22d18c40946a9e2529;hpb=a1d41b2aa6e18bf9a49b914a99dda8232c5d7762 diff --git a/hacks/jigsaw.c b/hacks/jigsaw.c index afeefc86..bdbe4468 100644 --- a/hacks/jigsaw.c +++ b/hacks/jigsaw.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1997, 1998 Jamie Zawinski +/* xscreensaver, Copyright (c) 1997, 1998, 2001 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 @@ -190,6 +190,14 @@ jigsaw_init(Display *dpy, Window window) x_border = (xgwa.width - (width * GRID_WIDTH)) / 2; y_border = (xgwa.height - (height * GRID_WIDTH)) / 2; + if (width < 4 || height < 4) + { + fprintf (stderr, "%s: window too small: %dx%d (need at least %dx%d)\n", + progname, xgwa.width, xgwa.height, + GRID_WIDTH * 4, GRID_HEIGHT * 4); + exit (1); + } + if (!state) state = (XPoint *) malloc(width * height * sizeof(XPoint)); gc = XCreateGC (dpy, window, 0, &gcv);