X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fboxfit.c;h=ce1a4ad5429012795f62631b151f173ce63d4ea6;hp=41878c0b5f52f52746b02d904975b19fb1ff6959;hb=6b1c86cf395f59389e4ece4ea8f4bea2c332745b;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439 diff --git a/hacks/boxfit.c b/hacks/boxfit.c index 41878c0b..ce1a4ad5 100644 --- a/hacks/boxfit.c +++ b/hacks/boxfit.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2005, 2006 Jamie Zawinski +/* xscreensaver, Copyright (c) 2005-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 @@ -121,8 +121,10 @@ reset_boxes (state *st) else { st->ncolors = get_integer_resource (st->dpy, "colors", "Colors"); /* re-get */ + if (st->ncolors < 1) st->ncolors = 1; make_smooth_colormap (st->dpy, st->xgwa.visual, st->xgwa.colormap, st->colors, &st->ncolors, True, 0, False); + if (st->ncolors < 1) abort(); XClearWindow (st->dpy, st->window); } }