mirror of
https://github.com/brl/mutter.git
synced 2024-11-12 17:27:03 -05:00
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
This commit is contained in:
parent
a51ad8f932
commit
4862e4cb39
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user