summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/genmipmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/genmipmap.c')
-rw-r--r--src/mesa/main/genmipmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/genmipmap.c b/src/mesa/main/genmipmap.c
index c952c4fda54..97d3c62b7bb 100644
--- a/src/mesa/main/genmipmap.c
+++ b/src/mesa/main/genmipmap.c
@@ -149,6 +149,11 @@ _mesa_generate_texture_mipmap(struct gl_context *ctx,
return;
}
+ if (srcImage->Width == 0 || srcImage->Height == 0) {
+ _mesa_unlock_texture(ctx, texObj);
+ return;
+ }
+
if (target == GL_TEXTURE_CUBE_MAP) {
GLuint face;
for (face = 0; face < 6; face++) {