diff --git a/src/backends/native/meta-kms-impl-device-atomic.c b/src/backends/native/meta-kms-impl-device-atomic.c index d3fd77268..f7f0d60bb 100644 --- a/src/backends/native/meta-kms-impl-device-atomic.c +++ b/src/backends/native/meta-kms-impl-device-atomic.c @@ -675,10 +675,12 @@ process_crtc_color_updates (MetaKmsImplDevice *impl_device, if (color_update->gamma.has_update) { MetaGammaLut *gamma = color_update->gamma.state; - struct drm_color_lut drm_color_lut[gamma->size]; + g_autofree struct drm_color_lut *drm_color_lut = NULL; int i; uint32_t color_lut_blob_id; + drm_color_lut = g_new (struct drm_color_lut, gamma->size); + for (i = 0; i < gamma->size; i++) { drm_color_lut[i].red = gamma->red[i];