From ab170237a2ce80560fbb97e370a064b3b0c9f7b3 Mon Sep 17 00:00:00 2001 From: Doyoun Kang Date: Mon, 19 Jun 2017 10:49:00 +0900 Subject: [PATCH] ecore_drm : add code to check null pointer Change-Id: I6e2ac60d2c7b4614b626f0f8ff73dfefc1920aeb --- src/lib/ecore_drm/ecore_drm_device.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) 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); -- 2.7.4