[Mesa-dev] [PATCH] intel: Fix yet-another-bug in intel_texsubimage_tiled_memcpy

Chad Versace chad.versace at linux.intel.com
Thu Sep 27 11:09:07 PDT 2012


The most recent commit that touched this function,

    commit 88836663ac3baaf156e84584674aac7dcbfc7e95
    Author: Chad Versace <chad.versace at linux.intel.com>
    Date:   Wed Sep 26 11:05:12 2012 -0700

        intel: Fix segfault in intel_texsubimage_tiled_memcpy

did fix the segfault, but introduced yet another bug. From Anholt: """You
need to still test format/type, because that's the incoming format (e.g.
GL_RGBA/GL_FLOAT) that you're trying to memcpy."""

This patch re-introduces the checks on the incoming format and type.

CC: Eric Anholt <eric at anholt.net>
Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
---
 src/mesa/drivers/dri/intel/intel_tex_subimage.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
index aa6f237..55d0bae 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
@@ -199,6 +199,8 @@ intel_texsubimage_tiled_memcpy(struct gl_context * ctx,
     * varying the arithmetic loop below.
     */
    if (!intel->has_llc ||
+       format != GL_BGRA ||
+       type != GL_UNSIGNED_BYTE ||
        texImage->TexFormat != MESA_FORMAT_ARGB8888 ||
        texImage->TexObject->Target != GL_TEXTURE_2D ||
        texImage->Level != 0 ||
-- 
1.7.12.1



More information about the mesa-dev mailing list