diff --git a/src/backends/meta-crtc.c b/src/backends/meta-crtc.c index 33d03ac39..33c31d098 100644 --- a/src/backends/meta-crtc.c +++ b/src/backends/meta-crtc.c @@ -229,11 +229,7 @@ meta_gamma_lut_copy_to_size (const MetaGammaLut *gamma, if (gamma->size == target_size) return meta_gamma_lut_copy (gamma); - out = meta_gamma_lut_new (target_size, NULL, NULL, NULL); - - out->red = g_new0 (uint16_t, target_size); - out->green = g_new0 (uint16_t, target_size); - out->blue = g_new0 (uint16_t, target_size); + out = meta_gamma_lut_new_sized (target_size); if (target_size >= gamma->size) { diff --git a/src/backends/native/meta-kms-crtc.c b/src/backends/native/meta-kms-crtc.c index 556f85355..e5405428c 100644 --- a/src/backends/native/meta-kms-crtc.c +++ b/src/backends/native/meta-kms-crtc.c @@ -170,12 +170,7 @@ read_crtc_legacy_gamma (MetaKmsCrtc *crtc, { crtc_state->gamma.size = drm_crtc->gamma_size; crtc_state->gamma.supported = drm_crtc->gamma_size != 0; - crtc_state->gamma.value = meta_gamma_lut_new (drm_crtc->gamma_size, - NULL, NULL, NULL); - - crtc_state->gamma.value->red = g_new0 (uint16_t, drm_crtc->gamma_size); - crtc_state->gamma.value->green = g_new0 (uint16_t, drm_crtc->gamma_size); - crtc_state->gamma.value->blue = g_new0 (uint16_t, drm_crtc->gamma_size); + crtc_state->gamma.value = meta_gamma_lut_new_sized (drm_crtc->gamma_size); drmModeCrtcGetGamma (meta_kms_impl_device_get_fd (impl_device), crtc->id,