summaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/OSXPixelBuffer.cxx11
-rw-r--r--vncviewer/Viewport.cxx3
-rw-r--r--vncviewer/Win32PixelBuffer.cxx1
-rw-r--r--vncviewer/X11PixelBuffer.cxx13
4 files changed, 15 insertions, 13 deletions
diff --git a/vncviewer/OSXPixelBuffer.cxx b/vncviewer/OSXPixelBuffer.cxx
index df82c86f..e9100f27 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>
@@ -47,16 +45,17 @@ OSXPixelBuffer::OSXPixelBuffer(int width, int height) :
data = new rdr::U8[width * height * format.bpp/8];
if (data == NULL)
- throw rfb::Exception(_("Error: Not enough memory for framebuffer"));
+ 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"));
}
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 66a78412..4daff164 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -27,6 +27,7 @@
#include <rfb/CMsgWriter.h>
#include <rfb/LogWriter.h>
+#include <rfb/Exception.h>
// FLTK can pull in the X11 headers on some systems
#ifndef XK_VoidSymbol
@@ -452,6 +453,8 @@ PlatformPixelBuffer* Viewport::createFramebuffer(int w, int h)
fb = new X11PixelBuffer(w, h);
#endif
} catch (rdr::Exception& e) {
+ vlog.error(_("Unable to create platform specific framebuffer: %s"), e.str());
+ vlog.error(_("Using platform independent framebuffer"));
fb = new FLTKPixelBuffer(w, h);
}
diff --git a/vncviewer/Win32PixelBuffer.cxx b/vncviewer/Win32PixelBuffer.cxx
index 48718165..3f825304 100644
--- a/vncviewer/Win32PixelBuffer.cxx
+++ b/vncviewer/Win32PixelBuffer.cxx
@@ -21,7 +21,6 @@
#include <config.h>
#endif
-#include <assert.h>
#include <stdlib.h>
#include <windows.h>
diff --git a/vncviewer/X11PixelBuffer.cxx b/vncviewer/X11PixelBuffer.cxx
index b729e800..59b90e2c 100644
--- a/vncviewer/X11PixelBuffer.cxx
+++ b/vncviewer/X11PixelBuffer.cxx
@@ -21,7 +21,6 @@
#include <config.h>
#endif
-#include <assert.h>
#include <stdlib.h>
#include <FL/x.H>
@@ -57,7 +56,7 @@ static PixelFormat display_pf()
if (format[i].depth == fl_visual->depth) break;
if (i == nformats)
- throw rfb::Exception(_("Error: display lacks pixmap format for default depth"));
+ throw rfb::Exception(_("Display lacks pixmap format for default depth"));
switch (format[i].bits_per_pixel) {
case 8:
@@ -66,7 +65,7 @@ static PixelFormat display_pf()
bpp = format[i].bits_per_pixel;
break;
default:
- throw rfb::Exception(_("Error: couldn't find suitable pixmap format"));
+ throw rfb::Exception(_("Couldn't find suitable pixmap format"));
}
XFree(format);
@@ -75,7 +74,7 @@ static PixelFormat display_pf()
trueColour = (fl_visual->c_class == TrueColor);
if (!trueColour)
- throw rfb::Exception(_("Error: only true colour displays supported"));
+ throw rfb::Exception(_("Only true colour displays supported"));
vlog.info(_("Using default colormap and visual, %sdepth %d."),
(fl_visual->c_class == TrueColor) ? "TrueColor, " :
@@ -104,10 +103,12 @@ X11PixelBuffer::X11PixelBuffer(int width, int height) :
if (!setupShm()) {
xim = XCreateImage(fl_display, fl_visual->visual, fl_visual->depth,
ZPixmap, 0, 0, width, height, BitmapPad(fl_display), 0);
- assert(xim);
+ if (!xim)
+ throw rfb::Exception(_("Could not create framebuffer image"));
xim->data = (char*)malloc(xim->bytes_per_line * xim->height);
- assert(xim->data);
+ if (!xim->data)
+ throw rfb::Exception(_("Not enough memory for framebuffer"));
}
data = (rdr::U8*)xim->data;