mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 14:40:10 +01:00
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:
parent
c432c86e6a
commit
f1c448d2e5
1 changed files with 5 additions and 0 deletions
|
|
@ -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 =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue