Use exceptions rather than asserts for for "normal" errors

Although these are rare, they are still not indicative of bugs so
an exception (which ends up in the log and might also be shown to
the user) is more appropriate than an assert. Asserts should only
be used to catch blatant API misuse and similar.
diff --git a/vncviewer/OSXPixelBuffer.cxx b/vncviewer/OSXPixelBuffer.cxx
index a3ee9d0..e9100f2 100644
--- a/vncviewer/OSXPixelBuffer.cxx
+++ b/vncviewer/OSXPixelBuffer.cxx
@@ -20,8 +20,6 @@
 #include <config.h>
 #endif
 
-#include <assert.h>
-
 #include <ApplicationServices/ApplicationServices.h>
 
 #include <FL/Fl_Window.H>
@@ -50,13 +48,14 @@
     throw rfb::Exception(_("Not enough memory for framebuffer"));
 
   lut = CGColorSpaceCreateDeviceRGB();
-  assert(lut);
+  if (!lut)
+    throw rfb::Exception(_("Could not create framebuffer device"));
 
   bitmap = CGBitmapContextCreate(data, width, height, 8, width*4, lut,
                                  kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little);
-  assert(bitmap);
-
   CGColorSpaceRelease(lut);
+  if (!bitmap)
+    throw rfb::Exception(_("Could not create framebuffer bitmap"));
 }