On 26 September 2012 11:22, Chad Versace <chad.vers...@linux.intel.com>wrote:

> The function segfaulted when a game called glTexSubImage2D on a texture
> with internalformat/format/type = GL_SLUMINANCE8/GL_BGRA/GL_UNSIGNED_BYTE.
>
> The function only supports MESA_FORMAT_ARGB8888 and returns early if it
> detects an unsupported format. Clearly, its detection condition was
> insufficient. This patch fixes it to explicity check for
> MESA_FORMAT_ARGB8888.
>
> CC: Kenneth Graunke <kenn...@whitecape.org>
> Signed-off-by: Chad Versace <chad.vers...@linux.intel.com>
> ---
>  src/mesa/drivers/dri/intel/intel_tex_subimage.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> index d3a8736..aa6f237 100644
> --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c
> @@ -199,8 +199,7 @@ 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 ||
>         pixels == NULL ||
> --
> 1.7.12.1
>

I'm not terribly familiar with this corner of the codebase, but it sounds
reasonable to me.

Acked-by: Paul Berry <stereotype...@gmail.com>

Since this patch fixes a bug in 413c4914129cd26ca87960852d8c0264c0fb29e7
(which is a candidate for the 9.0 branch), I'd recommend including the text
"Note: This is a candidate for the 9.0 branch." in the commit message.
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to