From: Doyoun Kang Date: Mon, 19 Jun 2017 01:49:00 +0000 (+0900) Subject: ecore_drm : add code to check null pointer X-Git-Tag: accepted/tizen/unified/20170630.083318^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F83%2F134483%2F2;p=platform%2Fupstream%2Fefl.git ecore_drm : add code to check null pointer Change-Id: I6e2ac60d2c7b4614b626f0f8ff73dfefc1920aeb --- diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c index 8f3cafb..5fe6e8e 100644 --- a/src/lib/ecore_drm/ecore_drm_device.c +++ b/src/lib/ecore_drm/ecore_drm_device.c @@ -993,8 +993,16 @@ ecore_drm_device_touch_rotation_set(Ecore_Drm_Device *dev, unsigned int rotation { if (edev->seat_caps & EVDEV_SEAT_TOUCH) { - default_w = (float)edev->output->current_mode->width; - default_h = (float)edev->output->current_mode->height; + if (edev->output && edev->output->current_mode) + { + default_w = (float)edev->output->current_mode->width; + default_h = (float)edev->output->current_mode->height; + } + else + { + default_w = 0.0; + default_h = 0.0; + } _ecore_drm_device_touch_matrix_identify(mat_translate); _ecore_drm_device_touch_matrix_identify(mat_rotation); @@ -1052,8 +1060,16 @@ ecore_drm_device_touch_transformation_set(Ecore_Drm_Device *dev, int offset_x, i { if (edev->seat_caps & EVDEV_SEAT_TOUCH) { - default_w = (float)edev->output->current_mode->width; - default_h = (float)edev->output->current_mode->height; + if (edev->output && edev->output->current_mode) + { + default_w = (float)edev->output->current_mode->width; + default_h = (float)edev->output->current_mode->height; + } + else + { + default_w = 0.0; + default_h = 0.0; + } _ecore_drm_device_touch_matrix_identify(mat_translate); _ecore_drm_device_touch_matrix_identify(mat_rotation);