From: Eric Anholt Date: Wed, 20 May 2009 21:00:32 +0000 (-0700) Subject: intel: Don't segfault on glGenerateMipmaps of a cube map with one face defined. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=467f18f7a5375af9a31031063536c927df3ea70c;p=mesa.git intel: Don't segfault on glGenerateMipmaps of a cube map with one face defined. This presumably applies to SGIS_generate_mipmaps as well. --- diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index 05a375e1f3b..b5cb7597d16 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -241,7 +241,7 @@ intel_tex_map_level_images(struct intel_context *intel, struct intel_texture_image *intelImage = intel_texture_image(intelObj->base.Image[face][level]); - if (intelImage->mt) { + if (intelImage && intelImage->mt) { intelImage->base.Data = intel_miptree_image_map(intel, intelImage->mt, @@ -268,7 +268,7 @@ intel_tex_unmap_level_images(struct intel_context *intel, struct intel_texture_image *intelImage = intel_texture_image(intelObj->base.Image[face][level]); - if (intelImage->mt) { + if (intelImage && intelImage->mt) { intel_miptree_image_unmap(intel, intelImage->mt); intelImage->base.Data = NULL; }