Mesa (7.11): intel: don't call unmap pbo if pbo is not mapped
Ian Romanick
idr at kemper.freedesktop.org
Thu Nov 3 18:56:01 UTC 2011
Module: Mesa
Branch: 7.11
Commit: 5459781715f47dcd3f93d84e69ab82245f684660
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5459781715f47dcd3f93d84e69ab82245f684660
Author: Yuanhan Liu <yuanhan.liu at linux.intel.com>
Date: Wed Nov 2 14:13:45 2011 +0800
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 at linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42268
---
src/mesa/drivers/dri/intel/intel_tex_image.c | 4 ++--
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 269faef..409c6f3 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) {
More information about the mesa-commit
mailing list