Fix out of bounds read
This commit is contained in:
parent
43a8db9e9d
commit
937ad56c26
|
@ -634,7 +634,7 @@ void APIENTRY glGetIntegerv(GLenum pname, GLint *params) {
|
|||
*params = MAX_LIGHTS;
|
||||
break;
|
||||
case GL_TEXTURE_BINDING_2D:
|
||||
*params = _glGetBoundTexture()->index;
|
||||
*params = (_glGetBoundTexture()) ? _glGetBoundTexture()->index : 0;
|
||||
break;
|
||||
case GL_DEPTH_FUNC:
|
||||
*params = DEPTH_FUNC;
|
||||
|
|
|
@ -371,7 +371,9 @@ void APIENTRY glDeleteTextures(GLsizei n, GLuint *textures) {
|
|||
txr->palette = NULL;
|
||||
}
|
||||
|
||||
named_array_release(&TEXTURE_OBJECTS, *textures++);
|
||||
named_array_release(&TEXTURE_OBJECTS, *textures);
|
||||
*textures = 0;
|
||||
textures++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,6 +34,9 @@ char named_array_used(NamedArray* array, unsigned int id) {
|
|||
unsigned int i = id / 8;
|
||||
unsigned int j = id % 8;
|
||||
|
||||
assert(i < array->max_element_count);
|
||||
assert(array->used_markers);
|
||||
|
||||
unsigned char v = array->used_markers[i] & (unsigned char) (1 << j);
|
||||
return !!(v);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user