intel: fix potential segfault error
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Tue, 1 Nov 2011 09:41:08 +0000 (17:41 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 2 Nov 2011 03:14:53 +0000 (11:14 +0800)
Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/intel/intel_tex_validate.c

index a657732027ae7dc762fa2aed651190736b799a95..f4c1a6886576fd28aa3741dc306b6ccc02a7892d 100644 (file)
@@ -125,14 +125,16 @@ intel_tex_map_image_for_swrast(struct intel_context *intel,
                               struct intel_texture_image *intel_image,
                               GLbitfield mode)
 {
-   int level = intel_image->base.Base.Level;
-   int face = intel_image->base.Base.Face;
+   int level;
+   int face;
    struct intel_mipmap_tree *mt;
    unsigned int x, y;
 
    if (!intel_image || !intel_image->mt)
       return;
 
+   level = intel_image->base.Base.Level;
+   face = intel_image->base.Base.Face;
    mt = intel_image->mt;
 
    if (mt->target == GL_TEXTURE_3D ||