--- xawtv-3.76/x11/blit.c	Tue Jul 23 04:53:07 2002
+++ xawtv-3.76-hack/x11/blit.c	Wed Sep 18 15:01:28 2002
@@ -275,6 +275,7 @@
     no_mitshm = 1;
 
  no_mitshm:
+    (*shm) = NULL;
     if (NULL == (ximage_data = malloc(width * height * pixmap_bytes))) {
 	fprintf(stderr,"out of memory\n");
 	exit(1);
@@ -290,7 +291,7 @@
 void
 x11_destroy_ximage(Display *dpy, XImage *ximage, XShmSegmentInfo *shm)
 {
-    if (shm) {
+    if (shm && !no_mitshm) {
 	XShmDetach(dpy, shm);
 	XDestroyImage(ximage);
 	shmdt(shm->shmaddr);
@@ -470,9 +471,9 @@
 	     int a, int b, int c, int d, int x, int y, int w, int h)
 {
     if (no_mitshm)
-	XvShmPutImage(dpy,im_port,dr,gc,xi,a,b,c,d,x,y,w,h,True);
-    else
 	XvPutImage(dpy,im_port,dr,gc,xi,a,b,c,d,x,y,w,h);
+    else
+	XvShmPutImage(dpy,im_port,dr,gc,xi,a,b,c,d,x,y,w,h,True);
 }
 #endif
 
