summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Cristau <jcristau@debian.org>2010-11-30 17:23:10 +0100
committerJeremy Huddleston <jeremyhu@apple.com>2010-12-02 12:14:43 -0800
commit08644d1c077de7603a4d88a00b5c6ebf8ec1556a (patch)
treedad2e720353b004a3e6409f822a75b8e74c322b5
parent55229588a49ae9c921f90da8e14b5b6908153a2f (diff)
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 8684543021b9b1aa165b1bc69bc58685cb5942c1)
-rw-r--r--hw/xfree86/dixmods/extmod/xf86dga2.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/hw/xfree86/dixmods/extmod/xf86dga2.c b/hw/xfree86/dixmods/extmod/xf86dga2.c
index 5367bcc42..3742c2b82 100644
--- a/hw/xfree86/dixmods/extmod/xf86dga2.c
+++ b/hw/xfree86/dixmods/extmod/xf86dga2.c
@@ -139,7 +139,7 @@ ProcXDGAOpenFramebuffer(ClientPtr client)
char *deviceName;
int nameSize;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if (!DGAAvailable(stuff->screen))
@@ -173,7 +173,7 @@ ProcXDGACloseFramebuffer(ClientPtr client)
{
REQUEST(xXDGACloseFramebufferReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if (!DGAAvailable(stuff->screen))
@@ -195,7 +195,7 @@ ProcXDGAQueryModes(ClientPtr client)
xXDGAModeInfo info;
XDGAModePtr mode;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXDGAQueryModesReq);
@@ -313,7 +313,7 @@ ProcXDGASetMode(ClientPtr client)
PixmapPtr pPix;
int size;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXDGASetModeReq);
@@ -402,7 +402,7 @@ ProcXDGASetViewport(ClientPtr client)
{
REQUEST(xXDGASetViewportReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -422,7 +422,7 @@ ProcXDGAInstallColormap(ClientPtr client)
int rc;
REQUEST(xXDGAInstallColormapReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -448,7 +448,7 @@ ProcXDGASelectInput(ClientPtr client)
{
REQUEST(xXDGASelectInputReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -468,7 +468,7 @@ ProcXDGAFillRectangle(ClientPtr client)
{
REQUEST(xXDGAFillRectangleReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -488,7 +488,7 @@ ProcXDGACopyArea(ClientPtr client)
{
REQUEST(xXDGACopyAreaReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -509,7 +509,7 @@ ProcXDGACopyTransparentArea(ClientPtr client)
{
REQUEST(xXDGACopyTransparentAreaReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -531,7 +531,7 @@ ProcXDGAGetViewportStatus(ClientPtr client)
REQUEST(xXDGAGetViewportStatusReq);
xXDGAGetViewportStatusReply rep;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -554,7 +554,7 @@ ProcXDGASync(ClientPtr client)
REQUEST(xXDGASyncReq);
xXDGASyncReply rep;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -599,7 +599,7 @@ ProcXDGAChangePixmapMode(ClientPtr client)
xXDGAChangePixmapModeReply rep;
int x, y;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -630,7 +630,7 @@ ProcXDGACreateColormap(ClientPtr client)
REQUEST(xXDGACreateColormapReq);
int result;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if(DGAClients[stuff->screen] != client)
@@ -677,7 +677,7 @@ ProcXF86DGAGetVideoLL(ClientPtr client)
int num, offset, flags;
char *name;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq);
@@ -715,7 +715,7 @@ ProcXF86DGADirectVideo(ClientPtr client)
XDGAModeRec mode;
REQUEST(xXF86DGADirectVideoReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq);
@@ -769,7 +769,7 @@ ProcXF86DGAGetViewPortSize(ClientPtr client)
REQUEST(xXF86DGAGetViewPortSizeReq);
xXF86DGAGetViewPortSizeReply rep;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq);
@@ -797,7 +797,7 @@ ProcXF86DGASetViewPort(ClientPtr client)
{
REQUEST(xXF86DGASetViewPortReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if (DGAClients[stuff->screen] != client)
@@ -824,7 +824,7 @@ ProcXF86DGAGetVidPage(ClientPtr client)
REQUEST(xXF86DGAGetVidPageReq);
xXF86DGAGetVidPageReply rep;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq);
@@ -843,7 +843,7 @@ ProcXF86DGASetVidPage(ClientPtr client)
{
REQUEST(xXF86DGASetVidPageReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq);
@@ -861,7 +861,7 @@ ProcXF86DGAInstallColormap(ClientPtr client)
int rc;
REQUEST(xXF86DGAInstallColormapReq);
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if (DGAClients[stuff->screen] != client)
@@ -888,7 +888,7 @@ ProcXF86DGAQueryDirectVideo(ClientPtr client)
REQUEST(xXF86DGAQueryDirectVideoReq);
xXF86DGAQueryDirectVideoReply rep;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq);
@@ -910,7 +910,7 @@ ProcXF86DGAViewPortChanged(ClientPtr client)
REQUEST(xXF86DGAViewPortChangedReq);
xXF86DGAViewPortChangedReply rep;
- if (stuff->screen > screenInfo.numScreens)
+ if (stuff->screen >= screenInfo.numScreens)
return BadValue;
if (DGAClients[stuff->screen] != client)