X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fcritical.c;h=81fd0c1a1056547e789302e5082bb4f03541f596;hp=ab3a6f7366e3ca853b6b2031f950dd212e105ef0;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hpb=88cfe534a698a0562e81345957a50714af1453bc diff --git a/hacks/critical.c b/hacks/critical.c index ab3a6f73..81fd0c1a 100644 --- a/hacks/critical.c +++ b/hacks/critical.c @@ -100,8 +100,10 @@ model_allocate (int model_w, int model_h) mm->height = model_h; mm->cells = malloc (sizeof (unsigned short) * model_w * model_h); - if (!mm->cells) + if (!mm->cells) { + free (mm); return 0; + } return mm; } @@ -290,7 +292,7 @@ critical_init (Display *dpy, Window window) model_w = 80; st->settings.cell_size = st->wattr.width / model_w; model_h = st->settings.cell_size ? - st->wattr.height / st->settings.cell_size : 0; + st->wattr.height / st->settings.cell_size : 1; /* Construct the initial model state. */ @@ -319,7 +321,7 @@ critical_init (Display *dpy, Window window) st->fgc = XCreateGC (st->dpy, st->window, 0, &st->gcv); -#ifdef HAVE_COCOA +#ifdef HAVE_JWXYZ jwxyz_XSetAntiAliasing (dpy, st->fgc, False); jwxyz_XSetAntiAliasing (dpy, st->bgc, False); #endif