diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 37fda3dc9c4..658b0e58e6d 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -1461,7 +1461,7 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level, struct gl_texture_object *texObj = NULL; if (texture > 0) - _mesa_lookup_texture(ctx, texture); + texObj = _mesa_lookup_texture(ctx, texture); if (!texObj) { _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);