-/* xscreensaver, Copyright (c) 1998-2006 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2010 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
#ifndef HAVE_COCOA
# define XK_MISCELLANY
# include <X11/keysymdef.h>
+# include <X11/Xlib.h>
# include <X11/Xutil.h>
# include <X11/Intrinsic.h>
#endif
long *temp_err;
int fs_scale = 1024;
int brightness = 75;
- int fs_direction;
#if 0
{
this_berr[x] = random() % (fs_scale * 2) - fs_scale;
/* (random errors in [-1 .. 1]) */
}
- fs_direction = 1;
for (y = 0; y < h; y++)
for (x = 0; x < w; x++)
image (regardless of whether it started as TrueColor/PseudoColor.)
*/
pick_a2_subimage (dpy, window, image, buf32, w, h);
+ free(image->data);
+ image->data = 0;
+ XDestroyImage(image);
/* Then dither the 32bpp image to a 6-color Apple][ colormap.
*/
basename = slash+1;
}
{
- char *dot=strchr(basename,'.');
+ char *dot=strrchr(basename,'.');
if (dot) *dot=0;
}
if (strlen(basename)>20) basename[20]=0;
free(mine->render_img);
free(mine->img_filename);
free(mine);
+ mine = 0;
return;
}
sprintf (buf, "%.100s: %.100s", progname, program);
perror(buf);
}
+
+ free(oprogram);
+ free(program);
}
static void
return 1;
}
- if (!mine->input_available_p) return 0;
+ if (!mine ||
+ !mine->input_available_p ||
+ !mine->pipe)
+ return 0;
rc=read (fileno (mine->pipe), (void *) buf, n);
if (rc>0) mine->lastc=buf[rc-1];
case A2CONTROLLER_FREE:
terminal_closegen(mine);
free(mine);
+ mine = 0;
return;
}
}
case A2CONTROLLER_FREE:
free(mine);
+ mine = 0;
break;
}