From: Pierre Ossman Date: Mon, 23 Mar 2009 16:28:53 +0000 (+0000) Subject: RRRegisterRate() can in theory fail. Make sure we catch this. X-Git-Tag: v0.0.90~80 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d108fb872ef6617deeceb6747719704ead437538;p=tigervnc.git RRRegisterRate() can in theory fail. Make sure we catch this. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3709 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/unix/xserver/hw/vnc/xvnc.cc b/unix/xserver/hw/vnc/xvnc.cc index 514ebf7d..ed09b802 100644 --- a/unix/xserver/hw/vnc/xvnc.cc +++ b/unix/xserver/hw/vnc/xvnc.cc @@ -802,7 +802,7 @@ static miPointerScreenFuncRec vfbPointerCursorFuncs = { static Bool vncRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) { vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; - Bool gotCurrent = FALSE; + Bool ret, gotCurrent = FALSE; int i; const int widths[] = { 1920, 1920, 1600, 1680, 1400, 1360, 1280, 1280, 1280, 1280, 1024, 800, 640 }; @@ -816,7 +816,9 @@ static Bool vncRandRGetInfo (ScreenPtr pScreen, Rotation *rotations) if (!pSize) return FALSE; - RRRegisterRate(pScreen, pSize, 60); + ret = RRRegisterRate(pScreen, pSize, 60); + if (!ret) + return FALSE; if ((widths[i] == pScreen->width) && (heights[i] == pScreen->height)) { RRSetCurrentConfig(pScreen, RR_Rotate_0, 60, pSize);