mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 11:32:04 +00:00
monitor-manager: Fix the max potential number of logical monitors
The max potential number of logical monitors (i.e. MetaMonitorInfos) is the number of CRTCs, not the number of outputs. In cases where we have more enabled CRTCs than connected outputs we would end up appending more MetaMonitorInfos to the GArray than the size it was initialized with which means the array would get re-allocated rendering invalid some MetaCRTC->logical_monitor pointers assigned previously and thus ending in crashes later on. https://bugzilla.gnome.org/show_bug.cgi?id=751638
This commit is contained in:
parent
4bebc5e5fa
commit
82bdd1e353
@ -178,7 +178,7 @@ make_logical_config (MetaMonitorManager *manager)
|
||||
unsigned int i, j;
|
||||
|
||||
monitor_infos = g_array_sized_new (FALSE, TRUE, sizeof (MetaMonitorInfo),
|
||||
manager->n_outputs);
|
||||
manager->n_crtcs);
|
||||
|
||||
/* Walk the list of MetaCRTCs, and build a MetaMonitorInfo
|
||||
for each of them, unless they reference a rectangle that
|
||||
|
Loading…
Reference in New Issue
Block a user