diff options
author | Owen W. Taylor <otaylor@fishsoup.net> | 2009-05-09 15:23:34 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-05-13 19:06:24 -0400 |
commit | ca792be42b238bd1c8f8a99ad72ea8558cbbfc32 (patch) | |
tree | ff99a77dde2303f3b0f4e66193b72552393a1ddb /src/mesa/drivers | |
parent | ea6a74abbe4053b958d640425e061f0ceec92291 (diff) |
radeon: Don't crash generating mipmaps when pixels=NULL
When a NULL value of pixels is passed to TexImage2D and
SGIS_generate_mipmap is enabled, don't try to generate the
mipmap tree: we don't have data yet for the texture and will
crash.
https://bugs.freedesktop.org/show_bug.cgi?id=21648
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texture.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 0f1d9c2158..564da19f58 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -612,11 +612,10 @@ static void radeon_teximage( _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } - } - - /* SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - radeon_generate_mipmap(ctx, texObj->Target, texObj); + /* SGIS_generate_mipmap */ + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + radeon_generate_mipmap(ctx, texObj->Target, texObj); + } } _mesa_unmap_teximage_pbo(ctx, packing); @@ -741,12 +740,12 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, int level, _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); } + /* GL_SGIS_generate_mipmap */ + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + radeon_generate_mipmap(ctx, texObj->Target, texObj); + } } - /* GL_SGIS_generate_mipmap */ - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - radeon_generate_mipmap(ctx, texObj->Target, texObj); - } radeon_teximage_unmap(image); _mesa_unmap_teximage_pbo(ctx, packing); |