changeset 14743:465c8617cbe5

We should not crash, only because we couldn't hide the cursor.
author al
date Sun, 20 Feb 2005 22:58:55 +0000
parents 76d461a061df
children 09b0883f5f0e
files libvo/x11_common.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/x11_common.c	Sun Feb 20 22:43:25 2005 +0000
+++ b/libvo/x11_common.c	Sun Feb 20 22:58:55 2005 +0000
@@ -176,7 +176,10 @@
         return;                 // do not hide, if we're playing at rootwin
 
     colormap = DefaultColormap(disp, DefaultScreen(disp));
-    XAllocNamedColor(disp, colormap, "black", &black, &dummy);
+    if ( !XAllocNamedColor(disp, colormap, "black", &black, &dummy) )
+    {
+      return; // color alloc failed, give up
+    }
     bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8, 8);
     no_ptr = XCreatePixmapCursor(disp, bm_no, bm_no, &black, &black, 0, 0);
     XDefineCursor(disp, win, no_ptr);