summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyril Brulebois <kibi@debian.org>2010-12-01 14:12:55 +0100
committerJulien Cristau <jcristau@debian.org>2010-12-01 23:49:36 +0100
commit6f7f3e2b799984e1b8aade89726dc226fc0b89ac (patch)
tree0e26945f9a56160e26c4b2253a1b5a0a3a6fd51b
parentbcab9213fbafa3091d2f5c831bb668cacaec5f8b (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> (cherry picked from commit 279ef1ffd787dba2f0d5056849b9cb15d36aa3eb)
-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 31fd431e7..d790b7162 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -1536,7 +1536,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;
@@ -2685,7 +2685,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;
@@ -3106,7 +3106,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 b3720f6f6..780ca42c9 100644
--- a/hw/dmx/glxProxy/glxcmdsswap.c
+++ b/hw/dmx/glxProxy/glxcmdsswap.c
@@ -251,7 +251,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 231b0985c..9f38908e8 100644
--- a/hw/kdrive/ephyr/ephyrdriext.c
+++ b/hw/kdrive/ephyr/ephyrdriext.c
@@ -470,7 +470,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;
}