st/mesa: check for zero-size image in st_TestProxyTexImage()

Fixes divide by zero issue in llvmpipe driver.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
This commit is contained in:
Brian Paul 2012-09-21 08:09:01 -06:00
parent c432c86e6a
commit f1c448d2e5

View file

@ -1379,6 +1379,11 @@ st_TestProxyTexImage(struct gl_context *ctx, GLenum target,
struct st_context *st = st_context(ctx);
struct pipe_context *pipe = st->pipe;
if (width == 0 || height == 0 || depth == 0) {
/* zero-sized images are legal, and always fit! */
return GL_TRUE;
}
if (pipe->screen->can_create_resource) {
/* Ask the gallium driver if the texture is too large */
struct gl_texture_object *texObj =