Unverified Commit 5487d52f authored by Mihai Moldovan's avatar Mihai Moldovan

Merge branch 'uli42-pr/various_backports' into 3.6.x

Attributes GH PR #581: https://github.com/ArcticaProject/nx-libs/pull/581 Fixes: ArcticaProject/nx-libs#558 Fixes: ArcticaProject/nx-libs#541 Fixes: ArcticaProject/nx-libs#542
parents c571aa9e aac4c5f5
...@@ -296,7 +296,7 @@ ProcDamageDispatch (ClientPtr client) ...@@ -296,7 +296,7 @@ ProcDamageDispatch (ClientPtr client)
REQUEST(xDamageReq); REQUEST(xDamageReq);
DamageClientPtr pDamageClient = GetDamageClient (client); DamageClientPtr pDamageClient = GetDamageClient (client);
if (pDamageClient->major_version > NUM_VERSION_REQUESTS) if (pDamageClient->major_version >= NUM_VERSION_REQUESTS)
return BadRequest; return BadRequest;
if (stuff->damageReqType > version_requests[pDamageClient->major_version]) if (stuff->damageReqType > version_requests[pDamageClient->major_version])
return BadRequest; return BadRequest;
......
...@@ -210,6 +210,7 @@ CloseDevice(register DeviceIntPtr dev) ...@@ -210,6 +210,7 @@ CloseDevice(register DeviceIntPtr dev)
if (dev->key->xkbInfo) if (dev->key->xkbInfo)
XkbFreeInfo(dev->key->xkbInfo); XkbFreeInfo(dev->key->xkbInfo);
#endif #endif
dev->key->xkbInfo = NULL;
free(dev->key->curKeySyms.map); free(dev->key->curKeySyms.map);
free(dev->key->modifierKeyMap); free(dev->key->modifierKeyMap);
free(dev->key); free(dev->key);
......
...@@ -463,7 +463,7 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what) ...@@ -463,7 +463,7 @@ cwPaintWindowBackground(WindowPtr pWin, RegionPtr pRegion, int what)
DrawablePtr pBackingDrawable; DrawablePtr pBackingDrawable;
int x_off, y_off, x_screen, y_screen; int x_off, y_off, x_screen, y_screen;
while (pWin && pWin->backgroundState == ParentRelative) while (pWin->backgroundState == ParentRelative)
pWin = pWin->parent; pWin = pWin->parent;
pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off, pBackingDrawable = cwGetBackingDrawable((DrawablePtr)pWin, &x_off,
......
...@@ -60,7 +60,8 @@ typedef struct { ...@@ -60,7 +60,8 @@ typedef struct {
unsigned long stateChanges; unsigned long stateChanges;
} cwPictureRec, *cwPicturePtr; } cwPictureRec, *cwPicturePtr;
#define getCwPicture(pPicture) ((cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr) #define getCwPicture(pPicture) \
(pPicture->pDrawable ? (cwPicturePtr)(pPicture)->devPrivates[cwPictureIndex].ptr : 0)
#define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (void *) (p)) #define setCwPicture(pPicture,p) ((pPicture)->devPrivates[cwPictureIndex].ptr = (void *) (p))
extern int cwPictureIndex; extern int cwPictureIndex;
......
...@@ -89,13 +89,10 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate) ...@@ -89,13 +89,10 @@ RRCrtcCreate(ScreenPtr pScreen, void *devPrivate)
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
/* make space for the crtc pointer */ /* make space for the crtc pointer */
if (pScrPriv->numCrtcs) crtcs = reallocarray(pScrPriv->crtcs,
crtcs = reallocarray(pScrPriv->crtcs, pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr));
pScrPriv->numCrtcs + 1, sizeof(RRCrtcPtr));
else
crtcs = malloc(sizeof(RRCrtcPtr));
if (!crtcs) if (!crtcs)
return FALSE; return NULL;
pScrPriv->crtcs = crtcs; pScrPriv->crtcs = crtcs;
crtc = calloc(1, sizeof(RRCrtcRec)); crtc = calloc(1, sizeof(RRCrtcRec));
...@@ -772,6 +769,7 @@ RRCrtcDestroyResource(void *value, XID pid) ...@@ -772,6 +769,7 @@ RRCrtcDestroyResource(void *value, XID pid)
free(crtc->gammaRed); free(crtc->gammaRed);
if (crtc->mode) if (crtc->mode)
RRModeDestroy(crtc->mode); RRModeDestroy(crtc->mode);
free(crtc->outputs);
free(crtc); free(crtc);
return 1; return 1;
} }
......
...@@ -74,13 +74,10 @@ RROutputCreate(ScreenPtr pScreen, ...@@ -74,13 +74,10 @@ RROutputCreate(ScreenPtr pScreen,
pScrPriv = rrGetScrPriv(pScreen); pScrPriv = rrGetScrPriv(pScreen);
if (pScrPriv->numOutputs) outputs = reallocarray(pScrPriv->outputs,
outputs = reallocarray(pScrPriv->outputs, pScrPriv->numOutputs + 1, sizeof(RROutputPtr));
pScrPriv->numOutputs + 1, sizeof(RROutputPtr));
else
outputs = malloc(sizeof(RROutputPtr));
if (!outputs) if (!outputs)
return FALSE; return NULL;
pScrPriv->outputs = outputs; pScrPriv->outputs = outputs;
......
...@@ -982,6 +982,7 @@ static PicturePtr createSourcePicture(void) ...@@ -982,6 +982,7 @@ static PicturePtr createSourcePicture(void)
pPicture->pDrawable = 0; pPicture->pDrawable = 0;
pPicture->pFormat = 0; pPicture->pFormat = 0;
pPicture->pNext = 0; pPicture->pNext = 0;
pPicture->devPrivates = 0;
SetPictureToDefaults(pPicture); SetPictureToDefaults(pPicture);
return pPicture; return pPicture;
......
...@@ -817,6 +817,7 @@ ProcXFixesExpandRegion (ClientPtr client) ...@@ -817,6 +817,7 @@ ProcXFixesExpandRegion (ClientPtr client)
RegionInit(&r, &pTmp[i], 0); RegionInit(&r, &pTmp[i], 0);
RegionUnion(pDestination, pDestination, &r); RegionUnion(pDestination, pDestination, &r);
} }
free(pTmp);
} }
if (ret == Success) if (ret == Success)
ret = client->noClientException; ret = client->noClientException;
......
...@@ -120,7 +120,7 @@ ProcXFixesDispatch (ClientPtr client) ...@@ -120,7 +120,7 @@ ProcXFixesDispatch (ClientPtr client)
REQUEST(xXFixesReq); REQUEST(xXFixesReq);
XFixesClientPtr pXFixesClient = GetXFixesClient (client); XFixesClientPtr pXFixesClient = GetXFixesClient (client);
if (pXFixesClient->major_version > NUM_VERSION_REQUESTS) if (pXFixesClient->major_version >= NUM_VERSION_REQUESTS)
return BadRequest; return BadRequest;
if (stuff->xfixesReqType > version_requests[pXFixesClient->major_version]) if (stuff->xfixesReqType > version_requests[pXFixesClient->major_version])
return BadRequest; return BadRequest;
......
...@@ -358,13 +358,6 @@ Bool found; ...@@ -358,13 +358,6 @@ Bool found;
remap->num_remap= 0; remap->num_remap= 0;
return; return;
} }
if (((present&PART_MASK)&(1<<OPTION))&&
((present&PART_MASK)!=(1<<OPTION))) {
PR_DEBUG("Options cannot appear with other parts\n");
PR_DEBUG("Illegal mapping ignored\n");
remap->num_remap= 0;
return;
}
if (((present&COMPONENT_MASK)&(1<<KEYMAP))&& if (((present&COMPONENT_MASK)&(1<<KEYMAP))&&
((present&COMPONENT_MASK)!=(1<<KEYMAP))) { ((present&COMPONENT_MASK)!=(1<<KEYMAP))) {
PR_DEBUG("Keymap cannot appear with other components\n"); PR_DEBUG("Keymap cannot appear with other components\n");
......
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