mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 03:30:04 +01:00
glx: Fix out-of-bounds reads from negative return
The callers of these functions were casting -1 to unsigned and then using 4GB indexes. By returning 0 we match all the other size functions. GLX size functions return -1 to indicate error, but GL size functions return 0. Signed-off-by: Nathan Kidd <nkidd@rocketsoftware.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1647>
This commit is contained in:
parent
eba15f1ba7
commit
29cfcf5259
1 changed files with 2 additions and 2 deletions
|
|
@ -105,7 +105,7 @@ __glGetMap_size(GLenum target, GLenum query)
|
|||
}
|
||||
break;
|
||||
}
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
GLint
|
||||
|
|
@ -164,7 +164,7 @@ __glGetPixelMap_size(GLenum map)
|
|||
query = GL_PIXEL_MAP_A_TO_A_SIZE;
|
||||
break;
|
||||
default:
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
glGetIntegerv(query, &size);
|
||||
return size;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue