From 18432a087cd9209b10f04457dbe58eb954c43904 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Wed, 10 Oct 2012 10:31:17 +0000 Subject: [PATCH] E (RandR): Add checks for current_mode being valid. Signed-off-by: Christopher Michael SVN revision: 77747 --- src/modules/conf_randr/e_smart_monitor.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/modules/conf_randr/e_smart_monitor.c b/src/modules/conf_randr/e_smart_monitor.c index aa78dcc0e..af806ced4 100644 --- a/src/modules/conf_randr/e_smart_monitor.c +++ b/src/modules/conf_randr/e_smart_monitor.c @@ -289,10 +289,13 @@ e_smart_monitor_crtc_set(Evas_Object *obj, E_Randr_Crtc_Info *crtc) sd->max.h = mode->height; /* set resolution label based on current mode */ - snprintf(buff, sizeof(buff), "%d x %d", - output->crtc->current_mode->width, - output->crtc->current_mode->height); - edje_object_part_text_set(sd->o_frame, "e.text.resolution", buff); + if ((output->crtc->current_mode)) + { + snprintf(buff, sizeof(buff), "%d x %d", + output->crtc->current_mode->width, + output->crtc->current_mode->height); + edje_object_part_text_set(sd->o_frame, "e.text.resolution", buff); + } /* tell monitor object we are enabled/disabled */ if (output->connection_status == @@ -1525,9 +1528,12 @@ _e_smart_monitor_menu_cb_resolution_pre(void *data, E_Menu *mn, E_Menu_Item *mi) obj); /* if this is the current mode, mark menu item as selected */ - if ((mode->width == sd->crtc->current_mode->width) && - (mode->height == sd->crtc->current_mode->height)) - e_menu_item_toggle_set(submi, EINA_TRUE); + if ((sd->crtc->current_mode)) + { + if ((mode->width == sd->crtc->current_mode->width) && + (mode->height == sd->crtc->current_mode->height)) + e_menu_item_toggle_set(submi, EINA_TRUE); + } } }