diff options
author | Chad Versace <[email protected]> | 2012-09-26 11:05:12 -0700 |
---|---|---|
committer | Chad Versace <[email protected]> | 2012-09-27 07:35:53 -0700 |
commit | b1d0fe022dc4826dadce014ab8fe062a82f75a16 (patch) | |
tree | 741fa91fdb7fcec0a5b9e79e3ba0dc04355dc142 /src | |
parent | 6d6aef79742ece3bb570ae44e6c13791aae15e01 (diff) |
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 <[email protected]>
Acked-by: Paul Berry <[email protected]>
Signed-off-by: Chad Versace <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_subimage.c | 3 |
1 files changed, 1 insertions, 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 d3a873655fb..aa6f237f742 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 || |