aboutsummaryrefslogtreecommitdiff
path: root/backend/drm/libliftoff.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-06-20 23:05:25 +0200
committerAlexander Orzechowski <alex@ozal.ski>2023-06-22 18:00:34 +0000
commitfffa1908af47d7cb1691425a0b6d9dccb01f1365 (patch)
tree5aa6ea34604576c025f4d03a5923b104ccb25036 /backend/drm/libliftoff.c
parent8714657d7bc6850a9d9c0591767bf13e80a55186 (diff)
backend/drm: fix libliftoff_plane double-free
Destroying the liftoff_device invalidates all of the liftoff_planes. Destroy the liftoff_planes before the liftoff_device to fix this.
Diffstat (limited to 'backend/drm/libliftoff.c')
-rw-r--r--backend/drm/libliftoff.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/backend/drm/libliftoff.c b/backend/drm/libliftoff.c
index 80410f43..7b2983bc 100644
--- a/backend/drm/libliftoff.c
+++ b/backend/drm/libliftoff.c
@@ -109,6 +109,11 @@ static void finish(struct wlr_drm_backend *drm) {
liftoff_output_destroy(crtc->liftoff);
}
+ for (size_t i = 0; i < drm->num_planes; i++) {
+ struct wlr_drm_plane *plane = &drm->planes[i];
+ liftoff_plane_destroy(plane->liftoff);
+ }
+
liftoff_device_destroy(drm->liftoff);
}