aboutsummaryrefslogtreecommitdiff
path: root/render/gles2/texture.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/gles2/texture.c')
-rw-r--r--render/gles2/texture.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/render/gles2/texture.c b/render/gles2/texture.c
index 1e80a8d6..041625fd 100644
--- a/render/gles2/texture.c
+++ b/render/gles2/texture.c
@@ -252,8 +252,10 @@ static struct wlr_texture_impl wlr_texture_impl = {
};
struct wlr_texture *gles2_texture_init(struct wlr_egl *egl) {
- struct wlr_gles2_texture *texture =
- calloc(1, sizeof(struct wlr_gles2_texture));
+ struct wlr_gles2_texture *texture;
+ if (!(texture = calloc(1, sizeof(struct wlr_gles2_texture)))) {
+ return NULL;
+ }
wlr_texture_init(&texture->wlr_texture, &wlr_texture_impl);
texture->egl = egl;
return &texture->wlr_texture;