summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authoral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-02-20 22:58:55 +0000
committeral <al@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-02-20 22:58:55 +0000
commit471f9a844fe48926f8caf7e7cd38f7a33ce3af87 (patch)
tree2535ff8148088a36799f85b22aad7c9ddc5d0a43 /libvo
parentf366d01286b8cafcb6df0dd7610fcba2dba4ea23 (diff)
downloadmpv-471f9a844fe48926f8caf7e7cd38f7a33ce3af87.tar.bz2
mpv-471f9a844fe48926f8caf7e7cd38f7a33ce3af87.tar.xz
We should not crash, only because we couldn't hide the cursor.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14744 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/x11_common.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index e0f0a74282..df03969706 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -176,7 +176,10 @@ void vo_hidecursor(Display * disp, Window win)
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);