From 471f9a844fe48926f8caf7e7cd38f7a33ce3af87 Mon Sep 17 00:00:00 2001 From: al Date: Sun, 20 Feb 2005 22:58:55 +0000 Subject: [PATCH] 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 --- libvo/x11_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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);