diff --git a/src/backends/meta-color-device.c b/src/backends/meta-color-device.c index 272fade57..e6854fc3a 100644 --- a/src/backends/meta-color-device.c +++ b/src/backends/meta-color-device.c @@ -1171,7 +1171,6 @@ meta_color_device_update (MetaColorDevice *color_device, MetaColorProfile *color_profile; MetaMonitor *monitor; size_t lut_size; - g_autoptr (MetaGammaLut) lut = NULL; color_profile = meta_color_device_get_assigned_profile (color_device); if (!color_profile) @@ -1206,11 +1205,16 @@ meta_color_device_update (MetaColorDevice *color_device, } lut_size = meta_monitor_get_gamma_lut_size (monitor); - lut = meta_color_profile_generate_gamma_lut (color_profile, - temperature, - lut_size); + if (lut_size > 0) + { + g_autoptr (MetaGammaLut) lut = NULL; - meta_monitor_set_gamma_lut (monitor, lut); + lut = meta_color_profile_generate_gamma_lut (color_profile, + temperature, + lut_size); + + meta_monitor_set_gamma_lut (monitor, lut); + } g_signal_emit (color_device, signals[UPDATED], 0); } diff --git a/src/backends/meta-color-profile.c b/src/backends/meta-color-profile.c index 573acadb8..82c235b0f 100644 --- a/src/backends/meta-color-profile.c +++ b/src/backends/meta-color-profile.c @@ -488,7 +488,7 @@ meta_color_profile_generate_gamma_lut (MetaColorProfile *color_profile, unsigned int temperature, size_t lut_size) { - g_return_val_if_fail (lut_size > 0, NULL); + g_assert (lut_size > 0); if (color_profile->calibration->has_vcgt) {