Module: Mesa Branch: 7.11 Commit: 5459781715f47dcd3f93d84e69ab82245f684660 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5459781715f47dcd3f93d84e69ab82245f684660
Author: Yuanhan Liu <[email protected]> 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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> 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) { _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
