diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2013-04-16 09:31:08 -0700 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2013-04-17 14:12:46 -0700 |
commit | 505ac6ddc6f83ee17655d54cf46ed71ead9e578c (patch) | |
tree | c1531beb0ea4e934b02e9ea60f1b7bdf5ad4c237 | |
parent | 50064164a461f838e01a875987034863b217f531 (diff) |
intel: Don't dereference a NULL pointer of calloc fails
The caller of NewTextureObject does the right thing if NULL is returned,
so this function should do the right thing too.
NOTE: This is a candidate for stable branches.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 1564f6cd97..9bba9898b4 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -35,6 +35,10 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target) (void) ctx; DBG("%s\n", __FUNCTION__); + + if (obj == NULL) + return NULL; + _mesa_initialize_texture_object(&obj->base, name, target); obj->needs_validate = true; |