This fixes an assertion in debug build, and probably a crash
in release build.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
return;
}
- /* Get the texture object by Name. */
- texObj = _mesa_lookup_texture(ctx, texture);
- if (!texObj) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(texture = %d)", caller, texture);
+ texObj = _mesa_lookup_texture_err(ctx, texture, caller);
+ if (!texObj)
return;
- }
/* Check target. This is done here so that _mesa_texture_storage
* can receive unsized formats.