[gnome-control-center/gnome-3-36] display: Add missing parameter checks on CcDisplayConfig methods



commit 2f1cefbed6d61457820a51ea0e595ba01aa82dcb
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Apr 14 11:04:05 2020 +1200

    display: Add missing parameter checks on CcDisplayConfig methods
    
    Closes #945

 panels/display/cc-display-config.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/panels/display/cc-display-config.c b/panels/display/cc-display-config.c
index 30c97c450..80aabc4f1 100644
--- a/panels/display/cc-display-config.c
+++ b/panels/display/cc-display-config.c
@@ -614,6 +614,7 @@ cc_display_config_set_minimum_size (CcDisplayConfig *self,
                                     int              width,
                                     int              height)
 {
+  g_return_if_fail (CC_IS_DISPLAY_CONFIG (self));
   CC_DISPLAY_CONFIG_GET_CLASS (self)->set_minimum_size (self, width, height);
 }
 
@@ -622,5 +623,7 @@ cc_display_config_is_scaled_mode_valid (CcDisplayConfig *self,
                                         CcDisplayMode   *mode,
                                         double           scale)
 {
+  g_return_val_if_fail (CC_IS_DISPLAY_CONFIG (self), FALSE);
+  g_return_val_if_fail (CC_IS_DISPLAY_MODE (mode), FALSE);
   return CC_DISPLAY_CONFIG_GET_CLASS (self)->is_scaled_mode_valid (self, mode, scale);
 }


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