diff -dPNur OSXvnc.orig/OSXvnc-server/main.c OSXvnc.new/OSXvnc-server/main.c
--- OSXvnc.orig/OSXvnc-server/main.c	2008-03-04 17:56:30.000000000 +0100
+++ OSXvnc.new/OSXvnc-server/main.c	2008-07-10 13:25:33.000000000 +0200
@@ -648,17 +649,20 @@
     
 	// otherwise CGDisplayBitsPerPixel doesn't
     // always works correctly after a resolution change
-	bitsPerSample = CGDisplayBitsPerSample(displayID);
-	
-    if (CGDisplaySamplesPerPixel(displayID) != 3) {
-        rfbLog("screen format not supported.\n");
+    bitsPerSample = CGDisplayBitsPerSample(displayID);
+    if (!bitsPerSample) {
+	bitsPerSample = 8;
+    } else {
+	if (CGDisplaySamplesPerPixel(displayID) != 3) {
+    	    rfbLog("screen format not supported: %i.\n", CGDisplaySamplesPerPixel(displayID));
 		return FALSE;
+	} 
     }
 
 	rfbScreen.width = CGDisplayPixelsWide(displayID);
 	rfbScreen.height = CGDisplayPixelsHigh(displayID);
 	rfbScreen.bitsPerPixel = CGDisplayBitsPerPixel(displayID);
-	rfbScreen.depth = CGDisplaySamplesPerPixel(displayID) * bitsPerSample;
+	rfbScreen.depth = 3 * bitsPerSample;
 	rfbScreen.paddedWidthInBytes = CGDisplayBytesPerRow(displayID);
 
     rfbServerFormat.bitsPerPixel = rfbScreen.bitsPerPixel;
