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()`
Simon Zeni 2 years ago committed by Simon Ser
parent e1ba64c4b7
commit ed71915742

@ -124,8 +124,8 @@ static void init_dmabuf_formats(struct wlr_egl *egl) {
for (int i = 0; i < formats_len; i++) { for (int i = 0; i < formats_len; i++) {
uint32_t fmt = formats[i]; uint32_t fmt = formats[i];
uint64_t *modifiers; uint64_t *modifiers = NULL;
EGLBoolean *external_only; EGLBoolean *external_only = NULL;
int modifiers_len = 0; int modifiers_len = 0;
if (!no_modifiers) { if (!no_modifiers) {
modifiers_len = get_egl_dmabuf_modifiers(egl, fmt, &modifiers, &external_only); modifiers_len = get_egl_dmabuf_modifiers(egl, fmt, &modifiers, &external_only);

Loading…
Cancel
Save