{
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) {
{
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;