aboutsummaryrefslogtreecommitdiff
path: root/render/wlr_texture.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-04-26 09:43:54 +0200
committerSimon Ser <contact@emersion.fr>2022-04-28 10:09:50 +0200
commit6c350799b22ddc5cb89467c95692437bbf0116b9 (patch)
tree4559c68cb117d9c044e79fb0fbb7453042538375 /render/wlr_texture.c
parent54653b5d95935e379e26db5518456a66384b5405 (diff)
Zero-initialize structs in init functions
Ensures there is no field left to its previous undefined value after calling an init function.
Diffstat (limited to 'render/wlr_texture.c')
-rw-r--r--render/wlr_texture.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/render/wlr_texture.c b/render/wlr_texture.c
index 2cdf08c5..36cbf136 100644
--- a/render/wlr_texture.c
+++ b/render/wlr_texture.c
@@ -1,12 +1,14 @@
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
+#include <string.h>
#include <wlr/render/interface.h>
#include <wlr/render/wlr_texture.h>
#include "types/wlr_buffer.h"
void wlr_texture_init(struct wlr_texture *texture,
const struct wlr_texture_impl *impl, uint32_t width, uint32_t height) {
+ memset(texture, 0, sizeof(*texture));
texture->impl = impl;
texture->width = width;
texture->height = height;