aboutsummaryrefslogtreecommitdiff
path: root/render/egl.c
diff options
context:
space:
mode:
authorSimon Zeni <simon@bl4ckb0ne.ca>2022-11-11 14:52:24 -0500
committerSimon Ser <contact@emersion.fr>2022-11-11 20:22:23 +0000
commited71915742160f2b9157adbad79364e22ab7ebda (patch)
tree109f1f79017694a4c5650967f383e8d413e54faa /render/egl.c
parente1ba64c4b769e265d96813e2f52060be79d10807 (diff)
render/egl: fix uninitialized pointers in init_dmabuf_formats
`modifiers` and `external_only` are never initialized, and free'd later. This commit explicitly initializes them to NULL to prevent segfaults on `free()`
Diffstat (limited to 'render/egl.c')
-rw-r--r--render/egl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/render/egl.c b/render/egl.c
index e3839c7d..0c25e036 100644
--- a/render/egl.c
+++ b/render/egl.c
@@ -124,8 +124,8 @@ static void init_dmabuf_formats(struct wlr_egl *egl) {
for (int i = 0; i < formats_len; i++) {
uint32_t fmt = formats[i];
- uint64_t *modifiers;
- EGLBoolean *external_only;
+ uint64_t *modifiers = NULL;
+ EGLBoolean *external_only = NULL;
int modifiers_len = 0;
if (!no_modifiers) {
modifiers_len = get_egl_dmabuf_modifiers(egl, fmt, &modifiers, &external_only);