mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 14:30:10 +01:00
getteximage: avoid to lookup textures with id 0
This fixes the following assertion when the key is 0.
main/hash.c:181: _mesa_HashLookup_unlocked: Assertion `key' failed.
Fixes: 633c959fae ("getteximage: Return correct error value when texure object is not found")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
5ac6ab701f
commit
5ae54c0cf7
1 changed files with 7 additions and 3 deletions
|
|
@ -1458,7 +1458,9 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
|
|||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
static const char *caller = "glGetTextureSubImage";
|
||||
struct gl_texture_object *texObj =
|
||||
struct gl_texture_object *texObj = NULL;
|
||||
|
||||
if (texture > 0)
|
||||
_mesa_lookup_texture(ctx, texture);
|
||||
|
||||
if (!texObj) {
|
||||
|
|
@ -1774,9 +1776,11 @@ _mesa_GetCompressedTextureSubImage(GLuint texture, GLint level,
|
|||
{
|
||||
GET_CURRENT_CONTEXT(ctx);
|
||||
static const char *caller = "glGetCompressedTextureImage";
|
||||
struct gl_texture_object *texObj;
|
||||
struct gl_texture_object *texObj = NULL;
|
||||
|
||||
if (texture > 0)
|
||||
texObj = _mesa_lookup_texture(ctx, texture);
|
||||
|
||||
texObj = _mesa_lookup_texture(ctx, texture);
|
||||
if (!texObj) {
|
||||
_mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue