From 0a897935ea44f062fb5fa3b6556d68815013087b Mon Sep 17 00:00:00 2001 From: Alan Griffiths Date: Thu, 22 Feb 2024 17:27:33 +0000 Subject: [PATCH] Ignore zero length gamma curves --- src/platforms/gbm-kms/server/kms/real_kms_output.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/platforms/gbm-kms/server/kms/real_kms_output.cpp b/src/platforms/gbm-kms/server/kms/real_kms_output.cpp index d8896d2f4cf..8bef51c5c33 100644 --- a/src/platforms/gbm-kms/server/kms/real_kms_output.cpp +++ b/src/platforms/gbm-kms/server/kms/real_kms_output.cpp @@ -360,6 +360,12 @@ void mgg::RealKMSOutput::set_power_mode(MirPowerMode mode) void mgg::RealKMSOutput::set_gamma(mg::GammaCurves const& gamma) { + if (!gamma.red.size()) + { + mir::log_warning("Ignoring attempt to set zero length gamma"); + return; + } + if (!ensure_crtc()) { mir::log_warning("Output %s has no associated CRTC to set gamma on",