[mutter] backend/dummy: Warn about missing dummy mode specs



commit 4862e4cb39bf9bf74219ce4a294408602fa0b879
Author: Christian Rauch <Rauch Christian gmx de>
Date:   Wed Oct 21 23:21:41 2020 +0100

    backend/dummy: Warn about missing dummy mode specs
    
    When malformed modes are provided and no valid mode spec is found, mutter
    will eventually try to access the last element of an empty list. Warn about
    this and exit properly.
    
    https://gitlab.gnome.org/GNOME/mutter/-/issues/1481

 src/backends/meta-monitor-manager-dummy.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/src/backends/meta-monitor-manager-dummy.c b/src/backends/meta-monitor-manager-dummy.c
index d817d0dc14..2ee3bf42cc 100644
--- a/src/backends/meta-monitor-manager-dummy.c
+++ b/src/backends/meta-monitor-manager-dummy.c
@@ -34,6 +34,7 @@
 #include "backends/meta-monitor.h"
 #include "backends/meta-monitor-config-manager.h"
 #include "backends/meta-output.h"
+#include "meta/main.h"
 #include "meta/util.h"
 
 #define MAX_MONITORS 5
@@ -190,6 +191,12 @@ append_monitor (MetaMonitorManager *manager,
         }
     }
 
+  if (!mode_specs)
+    {
+      g_warning ("Cannot create dummy output: No valid mode specs.");
+      meta_exit (META_EXIT_ERROR);
+    }
+
   for (l = mode_specs; l; l = l->next)
     {
       CrtcModeSpec *spec = l->data;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]