i965: Handle miptree creation failure in intel_alloc_texture_storage()
authorJuha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Mon, 12 May 2014 12:25:59 +0000 (15:25 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 26 Jun 2014 12:37:14 +0000 (15:37 +0300)
Check intel_miptree_create() return value before using it as
a pointer.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/intel_tex.c

index f18ca45647172c697425c82cdfd9b1f31a0498f1..556b787c3fc0109bf7a4542ef0e3df7fc6f57063 100644 (file)
@@ -147,6 +147,9 @@ intel_alloc_texture_storage(struct gl_context *ctx,
                                               num_samples,
                                               INTEL_MIPTREE_TILING_ANY);
 
+      if (intel_texobj->mt == NULL) {
+         return false;
+      }
    }
 
    for (face = 0; face < numFaces; face++) {