summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2010-12-01 14:12:55 +0100
committerKeith Packard <keithp@keithp.com>2010-12-01 10:33:57 -0800
commit279ef1ffd787dba2f0d5056849b9cb15d36aa3eb (patch)
tree1ff63105be22a1f76a23c3d46983b03f72d86530
parent8684543021b9b1aa165b1bc69bc58685cb5942c1 (diff)
Fix screen number checks.
screenInfo.numScreens is not a valid screen number, they go from 0 to numScreens - 1. Signed-off-by: Cyril Brulebois <kibi@debian.org> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/dmx/glxProxy/glxcmds.c6
-rw-r--r--hw/dmx/glxProxy/glxcmdsswap.c2
-rw-r--r--hw/kdrive/ephyr/ephyrdriext.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index 760212865..6a0aae79b 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -1531,7 +1531,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
int i, p;
screen = req->screen;
- if (screen > screenInfo.numScreens) {
+ if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
@@ -2680,7 +2680,7 @@ int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
int numFBConfigs, i, p;
__GLXscreenInfo *pGlxScreen;
- if (screen > screenInfo.numScreens) {
+ if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
@@ -3102,7 +3102,7 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
/*
** Look up screen and FBConfig.
*/
- if (screen > screenInfo.numScreens) {
+ if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
diff --git a/hw/dmx/glxProxy/glxcmdsswap.c b/hw/dmx/glxProxy/glxcmdsswap.c
index 44f1c1592..22940593b 100644
--- a/hw/dmx/glxProxy/glxcmdsswap.c
+++ b/hw/dmx/glxProxy/glxcmdsswap.c
@@ -252,7 +252,7 @@ int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
__GLX_SWAP_INT(&req->screen);
screen = req->screen;
- if (screen > screenInfo.numScreens) {
+ if (screen >= screenInfo.numScreens) {
/* The client library must send a valid screen number. */
client->errorValue = screen;
return BadValue;
diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c
index 8874a436e..6945f5b61 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -398,7 +398,7 @@ EphyrDuplicateVisual (unsigned int a_screen,
int i=0 ;
EPHYR_LOG ("enter\n") ;
- if (a_screen > screenInfo.numScreens) {
+ if (a_screen >= screenInfo.numScreens) {
EPHYR_LOG_ERROR ("bad screen number\n") ;
goto out;
}