[mutter] monitor-manager: Fix the max potential number of logical monitors



commit 82bdd1e353f3158d84deb8dffba66e8232a13769
Author: Rui Matos <tiagomatos gmail com>
Date:   Fri Jul 3 18:01:14 2015 +0200

    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

 src/backends/meta-monitor-manager.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/backends/meta-monitor-manager.c b/src/backends/meta-monitor-manager.c
index 38ccc72..56a52bb 100644
--- a/src/backends/meta-monitor-manager.c
+++ b/src/backends/meta-monitor-manager.c
@@ -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


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