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()`
This commit is contained in:
Simon Zeni 2022-11-11 14:52:24 -05:00 committed by Simon Ser
parent e1ba64c4b7
commit ed71915742
1 changed files with 2 additions and 2 deletions

View File

@ -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);