summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texgetimage.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 658b0e58e6d..715bc249be1 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -1458,13 +1458,10 @@ _mesa_GetTextureSubImage(GLuint texture, GLint level,
{
GET_CURRENT_CONTEXT(ctx);
static const char *caller = "glGetTextureSubImage";
- struct gl_texture_object *texObj = NULL;
-
- if (texture > 0)
- texObj = _mesa_lookup_texture(ctx, texture);
+ struct gl_texture_object *texObj =
+ _mesa_lookup_texture_err(ctx, texture, caller);
if (!texObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
return;
}
@@ -1778,11 +1775,8 @@ _mesa_GetCompressedTextureSubImage(GLuint texture, GLint level,
static const char *caller = "glGetCompressedTextureImage";
struct gl_texture_object *texObj = NULL;
- if (texture > 0)
- texObj = _mesa_lookup_texture(ctx, texture);
-
+ texObj = _mesa_lookup_texture_err(ctx, texture, caller);
if (!texObj) {
- _mesa_error(ctx, GL_INVALID_VALUE, "%s(texture)", caller);
return;
}