summaryrefslogtreecommitdiffstats
path: root/src/mesa/program/nvfragparse.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/program/nvfragparse.c')
-rw-r--r--src/mesa/program/nvfragparse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/program/nvfragparse.c b/src/mesa/program/nvfragparse.c
index bcc553a9bc6..20c8579b08b 100644
--- a/src/mesa/program/nvfragparse.c
+++ b/src/mesa/program/nvfragparse.c
@@ -582,7 +582,7 @@ Parse_TextureImageId(struct parse_state *parseState,
RETURN_ERROR1("Expected TEX# source");
}
unit = atoi((const char *) imageSrc + 3);
- if ((unit < 0 || unit > MAX_TEXTURE_IMAGE_UNITS) ||
+ if ((unit < 0 || unit >= MAX_TEXTURE_IMAGE_UNITS) ||
(unit == 0 && (imageSrc[3] != '0' || imageSrc[4] != 0))) {
RETURN_ERROR1("Invalied TEX# source index");
}