mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 13:00:09 +01:00
mesa: Fix off-by-one error in Parse_TextureImageId.
Fixes out-of-bounds write defect reported by Coverity. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
3e7b3a04bf
commit
61b62c007a
1 changed files with 1 additions and 1 deletions
|
|
@ -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");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue