Commit d1a967f3 authored by Ulrich Sibiller's avatar Ulrich Sibiller

randr: fix broken macros / memory corruption

By casting the rrScrPriv to ScreenPtr we are using the offsets from the Screen structure for referencing data in the rrScrPriv structure causing data corruption. As both macros use the same casting this still works until the location where the data resides is overwritten. For 64bit the location was the "rotations" member in rrScrPriv which was not problematic because it is barely used. But on 32bit it was "numCrtcs" which is heavily used. On unwrap this was 0 and lead to a segfault. Fixes ArcticaProject/nx-libs#943
parent 67330d9e
......@@ -69,12 +69,12 @@
static int RRNScreens;
#define wrap(priv,real,mem,func) {\
((ScreenPtr)priv)->mem = ((ScreenPtr)real)->mem; \
((ScreenPtr)real)->mem = func; \
priv->mem = real->mem; \
real->mem = func; \
}
#define unwrap(priv,real,mem) {\
((ScreenPtr)real)->mem = ((ScreenPtr)priv)->mem; \
real->mem = priv->mem; \
}
static int ProcRRDispatch(ClientPtr pClient);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment