diff options
author | Samuel Pitoiset <[email protected]> | 2017-06-21 09:07:36 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2017-06-22 10:41:10 +0200 |
commit | 75044f0854f9b7c572c2117256605aa76acf1573 (patch) | |
tree | 33d307146e3613988b5488e4bbe814bf7a76eb36 /src/mesa/main | |
parent | da2e52b382351fea6f0321ad9a24c099b360e685 (diff) |
mesa: check for allocation failures in _mesa_new_texture_object()
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/texobj.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 1877262ed65..ed1eaf9b77b 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -234,11 +234,14 @@ _mesa_get_current_tex_object(struct gl_context *ctx, GLenum target) * \return pointer to new texture object. */ struct gl_texture_object * -_mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target ) +_mesa_new_texture_object(struct gl_context *ctx, GLuint name, GLenum target) { struct gl_texture_object *obj; - (void) ctx; + obj = MALLOC_STRUCT(gl_texture_object); + if (!obj) + return NULL; + _mesa_initialize_texture_object(ctx, obj, name, target); return obj; } |