summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2011-11-02 14:13:45 +0800
committerIan Romanick <ian.d.romanick@intel.com>2011-11-03 11:55:39 -0700
commit5459781715f47dcd3f93d84e69ab82245f684660 (patch)
treee231cf259dcf93fe953ee615f56a5f00bdacc244
parentb95767a57ad499a2ed7431e8b0b52966c6dc0a45 (diff)
intel: don't call unmap pbo if pbo is not mapped
The PBO only needs to be unmapped if one of the previous calls to _mesa_validate_pbo_* succeeded. In this case, pixels will be non-NULL. Various paths through _mesa_unmap_texmiage_pbo can hit assertion failures or segfaults if the buffer is not mapped. To work around this, move the call to _mesa_unmap_teximage_pbo inside the last 'if (pixels)' block. NOTE: this is just for 7.11 stable branch Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42268
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 269faefa1c0..409c6f31988 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -595,9 +595,9 @@ intelTexImage(struct gl_context * ctx,
format, type, pixels, unpack)) {
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage");
}
- }
- _mesa_unmap_teximage_pbo(ctx, unpack);
+ _mesa_unmap_teximage_pbo(ctx, unpack);
+ }
if (intel->must_use_separate_stencil
&& texImage->TexFormat == MESA_FORMAT_S8_Z24) {