[mutter] monitor: Only assign suggested positions to valid pointers



commit 32d7c5fbfb572e654d8a8495a9a467dd5ecc2fd0
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Wed Mar 27 05:08:39 2019 +0100

    monitor: Only assign suggested positions to valid pointers
    
    Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/522>

 src/backends/meta-monitor.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/meta-monitor.c b/src/backends/meta-monitor.c
index 5fc8b1f858..2d9ec50518 100644
--- a/src/backends/meta-monitor.c
+++ b/src/backends/meta-monitor.c
@@ -730,8 +730,11 @@ meta_monitor_normal_get_suggested_position (MetaMonitor *monitor,
   if (output_info->suggested_x < 0 && output_info->suggested_y < 0)
     return FALSE;
 
-  *x = output_info->suggested_x;
-  *y = output_info->suggested_y;
+  if (x)
+    *x = output_info->suggested_x;
+
+  if (y)
+    *y = output_info->suggested_y;
 
   return TRUE;
 }


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