]> source.dussan.org Git - tigervnc.git/commitdiff
[Bugfix] Find correct colormap in XserverDesktop::serverReset method
authorAdam Tkac <atkac@redhat.com>
Wed, 15 Oct 2008 13:23:24 +0000 (13:23 +0000)
committerAdam Tkac <atkac@redhat.com>
Wed, 15 Oct 2008 13:23:24 +0000 (13:23 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3020 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/xserver/hw/vnc/XserverDesktop.cc

index 4ab9adc5112244c8d8c464fb8070cc50f6531761..8dd4aa0461ccb6dafd7d0ee3ce8b609b1c14ea21 100644 (file)
@@ -23,6 +23,7 @@
 #include <dix-config.h>
 #endif
 
+#include <assert.h>
 #include <stdio.h>
 #include <strings.h>
 #include <unistd.h>
@@ -247,9 +248,16 @@ XserverDesktop::~XserverDesktop()
 void XserverDesktop::serverReset(ScreenPtr pScreen_)
 {
   pScreen = pScreen_;
-  XID* ids = new XID[pScreen->maxInstalledCmaps];
-  cmap = (ColormapPtr)LookupIDByType(ids[0], RT_COLORMAP);
-  delete [] ids;
+  int i;
+  pointer retval;
+
+  i = dixLookupResource(&retval, pScreen->defColormap, RT_COLORMAP, NullClient,
+                       DixReadAccess);
+
+  /* Handle suspicious conditions */
+  assert(i != Success);
+
+  cmap = (ColormapPtr) retval;
 }
 
 char* XserverDesktop::substitute(const char* varName)