From 04e9eaebe3feffa4bd5acc0c942bf7542577f5bf Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 4 Feb 2022 03:31:13 +0000 Subject: [PATCH] drm: Be safe against blob destruction --- src/drm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/drm.cpp b/src/drm.cpp index 78b55f6..4945d22 100644 --- a/src/drm.cpp +++ b/src/drm.cpp @@ -845,9 +845,9 @@ int drm_commit(struct drm_t *drm, struct Composite_t *pComposite, struct VulkanP for ( size_t i = 0; i < drm->crtcs.size(); i++ ) { - if ( drm->current.mode_id ) + if ( drm->pending.mode_id != drm->current.mode_id ) drmModeDestroyPropertyBlob(drm->fd, drm->current.mode_id); - if ( drm->current.gamma_lut_id ) + if ( drm->pending.gamma_lut_id != drm->current.gamma_lut_id ) drmModeDestroyPropertyBlob(drm->fd, drm->current.gamma_lut_id); drm->crtcs[i].current = drm->crtcs[i].pending; }