dri: report failed memory allocation
ProcXF86DRIGetDrawableInfo() should report failed memory allocation instead of pretending everything's okay. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1797>
This commit is contained in:
parent
2539ddae50
commit
94d942267a
|
@ -425,7 +425,9 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
|
||||||
/* Clip cliprects to screen dimensions (redirected windows) */
|
/* Clip cliprects to screen dimensions (redirected windows) */
|
||||||
pClippedRects = xallocarray(rep.numClipRects, sizeof(drm_clip_rect_t));
|
pClippedRects = xallocarray(rep.numClipRects, sizeof(drm_clip_rect_t));
|
||||||
|
|
||||||
if (pClippedRects) {
|
if (!pClippedRects)
|
||||||
|
return BadAlloc;
|
||||||
|
|
||||||
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
|
ScreenPtr pScreen = screenInfo.screens[stuff->screen];
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
@ -442,11 +444,6 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client)
|
||||||
}
|
}
|
||||||
|
|
||||||
rep.numClipRects = j;
|
rep.numClipRects = j;
|
||||||
}
|
|
||||||
else {
|
|
||||||
rep.numClipRects = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects;
|
rep.length += sizeof(drm_clip_rect_t) * rep.numClipRects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue