intel: Fix segfault in intel_texsubimage_tiled_memcpy
authorChad Versace <chad.versace@linux.intel.com>
Wed, 26 Sep 2012 18:05:12 +0000 (11:05 -0700)
committerChad Versace <chad.versace@linux.intel.com>
Thu, 27 Sep 2012 14:35:53 +0000 (07:35 -0700)
commitb1d0fe022dc4826dadce014ab8fe062a82f75a16
tree741fa91fdb7fcec0a5b9e79e3ba0dc04355dc142
parent6d6aef79742ece3bb570ae44e6c13791aae15e01
intel: Fix segfault in intel_texsubimage_tiled_memcpy

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.

Note: This is a candidate for the 9.0 branch (fixes 413c491).
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/drivers/dri/intel/intel_tex_subimage.c