i965: skip too small size mipmap
authorZou Nan hai <nanhai.zou@intel.com>
Thu, 6 Jan 2011 03:36:23 +0000 (11:36 +0800)
committerZou Nan hai <nanhai.zou@intel.com>
Thu, 6 Jan 2011 03:36:23 +0000 (11:36 +0800)
this fixes doom3 crash.

src/mesa/drivers/dri/intel/intel_tex_validate.c

index f1c6239..31c0a83 100644 (file)
@@ -156,8 +156,10 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
       for (i = tObj->BaseLevel; i <= intelObj->_MaxLevel; i++) {
          struct intel_texture_image *intelImage =
             intel_texture_image(intelObj->base.Image[face][i]);
-
-         /* Need to import images in main memory or held in other trees.
+        /* skip too small size mipmap */
+        if (intelImage == NULL)
+                break;
+        /* Need to import images in main memory or held in other trees.
          * If it's a render target, then its data isn't needed to be in
          * the object tree (otherwise we'd be FBO incomplete), and we need
          * to keep track of the image's MT as needing to be pulled in still,