mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 08:10:03 +01:00
DGA: fix screen number check
screenInfo.numScreens is not a valid screen number, they go from 0 to
numScreens - 1.
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 8684543021)
This commit is contained in:
parent
55229588a4
commit
08644d1c07
1 changed files with 23 additions and 23 deletions
|
|
@ -139,7 +139,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client)
|
||||||
char *deviceName;
|
char *deviceName;
|
||||||
int nameSize;
|
int nameSize;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (!DGAAvailable(stuff->screen))
|
if (!DGAAvailable(stuff->screen))
|
||||||
|
|
@ -173,7 +173,7 @@ ProcXDGACloseFramebuffer(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXDGACloseFramebufferReq);
|
REQUEST(xXDGACloseFramebufferReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (!DGAAvailable(stuff->screen))
|
if (!DGAAvailable(stuff->screen))
|
||||||
|
|
@ -195,7 +195,7 @@ ProcXDGAQueryModes(ClientPtr client)
|
||||||
xXDGAModeInfo info;
|
xXDGAModeInfo info;
|
||||||
XDGAModePtr mode;
|
XDGAModePtr mode;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
|
REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
|
||||||
|
|
@ -313,7 +313,7 @@ ProcXDGASetMode(ClientPtr client)
|
||||||
PixmapPtr pPix;
|
PixmapPtr pPix;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXDGASetModeReq);
|
REQUEST_SIZE_MATCH(xXDGASetModeReq);
|
||||||
|
|
@ -402,7 +402,7 @@ ProcXDGASetViewport(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXDGASetViewportReq);
|
REQUEST(xXDGASetViewportReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -422,7 +422,7 @@ ProcXDGAInstallColormap(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
REQUEST(xXDGAInstallColormapReq);
|
REQUEST(xXDGAInstallColormapReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -448,7 +448,7 @@ ProcXDGASelectInput(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXDGASelectInputReq);
|
REQUEST(xXDGASelectInputReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -468,7 +468,7 @@ ProcXDGAFillRectangle(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXDGAFillRectangleReq);
|
REQUEST(xXDGAFillRectangleReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -488,7 +488,7 @@ ProcXDGACopyArea(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXDGACopyAreaReq);
|
REQUEST(xXDGACopyAreaReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -509,7 +509,7 @@ ProcXDGACopyTransparentArea(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXDGACopyTransparentAreaReq);
|
REQUEST(xXDGACopyTransparentAreaReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -531,7 +531,7 @@ ProcXDGAGetViewportStatus(ClientPtr client)
|
||||||
REQUEST(xXDGAGetViewportStatusReq);
|
REQUEST(xXDGAGetViewportStatusReq);
|
||||||
xXDGAGetViewportStatusReply rep;
|
xXDGAGetViewportStatusReply rep;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -554,7 +554,7 @@ ProcXDGASync(ClientPtr client)
|
||||||
REQUEST(xXDGASyncReq);
|
REQUEST(xXDGASyncReq);
|
||||||
xXDGASyncReply rep;
|
xXDGASyncReply rep;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -599,7 +599,7 @@ ProcXDGAChangePixmapMode(ClientPtr client)
|
||||||
xXDGAChangePixmapModeReply rep;
|
xXDGAChangePixmapModeReply rep;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -630,7 +630,7 @@ ProcXDGACreateColormap(ClientPtr client)
|
||||||
REQUEST(xXDGACreateColormapReq);
|
REQUEST(xXDGACreateColormapReq);
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if(DGAClients[stuff->screen] != client)
|
if(DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -677,7 +677,7 @@ ProcXF86DGAGetVideoLL(ClientPtr client)
|
||||||
int num, offset, flags;
|
int num, offset, flags;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
|
REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
|
||||||
|
|
@ -715,7 +715,7 @@ ProcXF86DGADirectVideo(ClientPtr client)
|
||||||
XDGAModeRec mode;
|
XDGAModeRec mode;
|
||||||
REQUEST(xXF86DGADirectVideoReq);
|
REQUEST(xXF86DGADirectVideoReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
|
REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
|
||||||
|
|
@ -769,7 +769,7 @@ ProcXF86DGAGetViewPortSize(ClientPtr client)
|
||||||
REQUEST(xXF86DGAGetViewPortSizeReq);
|
REQUEST(xXF86DGAGetViewPortSizeReq);
|
||||||
xXF86DGAGetViewPortSizeReply rep;
|
xXF86DGAGetViewPortSizeReply rep;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
|
REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
|
||||||
|
|
@ -797,7 +797,7 @@ ProcXF86DGASetViewPort(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86DGASetViewPortReq);
|
REQUEST(xXF86DGASetViewPortReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (DGAClients[stuff->screen] != client)
|
if (DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -824,7 +824,7 @@ ProcXF86DGAGetVidPage(ClientPtr client)
|
||||||
REQUEST(xXF86DGAGetVidPageReq);
|
REQUEST(xXF86DGAGetVidPageReq);
|
||||||
xXF86DGAGetVidPageReply rep;
|
xXF86DGAGetVidPageReply rep;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
|
REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
|
||||||
|
|
@ -843,7 +843,7 @@ ProcXF86DGASetVidPage(ClientPtr client)
|
||||||
{
|
{
|
||||||
REQUEST(xXF86DGASetVidPageReq);
|
REQUEST(xXF86DGASetVidPageReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
|
REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
|
||||||
|
|
@ -861,7 +861,7 @@ ProcXF86DGAInstallColormap(ClientPtr client)
|
||||||
int rc;
|
int rc;
|
||||||
REQUEST(xXF86DGAInstallColormapReq);
|
REQUEST(xXF86DGAInstallColormapReq);
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (DGAClients[stuff->screen] != client)
|
if (DGAClients[stuff->screen] != client)
|
||||||
|
|
@ -888,7 +888,7 @@ ProcXF86DGAQueryDirectVideo(ClientPtr client)
|
||||||
REQUEST(xXF86DGAQueryDirectVideoReq);
|
REQUEST(xXF86DGAQueryDirectVideoReq);
|
||||||
xXF86DGAQueryDirectVideoReply rep;
|
xXF86DGAQueryDirectVideoReply rep;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq);
|
REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq);
|
||||||
|
|
@ -910,7 +910,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client)
|
||||||
REQUEST(xXF86DGAViewPortChangedReq);
|
REQUEST(xXF86DGAViewPortChangedReq);
|
||||||
xXF86DGAViewPortChangedReply rep;
|
xXF86DGAViewPortChangedReply rep;
|
||||||
|
|
||||||
if (stuff->screen > screenInfo.numScreens)
|
if (stuff->screen >= screenInfo.numScreens)
|
||||||
return BadValue;
|
return BadValue;
|
||||||
|
|
||||||
if (DGAClients[stuff->screen] != client)
|
if (DGAClients[stuff->screen] != client)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue