mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 04:45:58 +01:00
linux-dmabuf-v1: fix wlr_drm_format_set leak in feedback_compile()
Fixes: 43b25fd34e
("dmabuf: Remove assumption that all mods are in fallback tranche")
This commit is contained in:
parent
43b25fd34e
commit
a0ebc401d0
1 changed files with 7 additions and 3 deletions
|
@ -509,7 +509,7 @@ static struct wlr_linux_dmabuf_feedback_v1_compiled *feedback_compile(
|
|||
const struct wlr_linux_dmabuf_feedback_v1_tranche *tranche = &tranches[i];
|
||||
if (!wlr_drm_format_set_union(&all_formats, &all_formats, &tranche->formats)) {
|
||||
wlr_log(WLR_ERROR, "Failed to union scanout formats into one tranche");
|
||||
return false;
|
||||
goto err_all_formats;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -534,7 +534,7 @@ static struct wlr_linux_dmabuf_feedback_v1_compiled *feedback_compile(
|
|||
wlr_log_errno(WLR_ERROR, "mmap failed");
|
||||
close(rw_fd);
|
||||
close(ro_fd);
|
||||
return NULL;
|
||||
goto err_all_formats;
|
||||
}
|
||||
|
||||
close(rw_fd);
|
||||
|
@ -560,7 +560,7 @@ static struct wlr_linux_dmabuf_feedback_v1_compiled *feedback_compile(
|
|||
tranches_len * sizeof(struct wlr_linux_dmabuf_feedback_v1_compiled_tranche));
|
||||
if (compiled == NULL) {
|
||||
close(ro_fd);
|
||||
return NULL;
|
||||
goto err_all_formats;
|
||||
}
|
||||
|
||||
compiled->main_device = feedback->main_device;
|
||||
|
@ -604,11 +604,15 @@ static struct wlr_linux_dmabuf_feedback_v1_compiled *feedback_compile(
|
|||
compiled_tranche->indices.size = n * sizeof(uint16_t);
|
||||
}
|
||||
|
||||
wlr_drm_format_set_finish(&all_formats);
|
||||
|
||||
return compiled;
|
||||
|
||||
error_compiled:
|
||||
close(compiled->table_fd);
|
||||
free(compiled);
|
||||
err_all_formats:
|
||||
wlr_drm_format_set_finish(&all_formats);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue