ecore_drm : add code to check null pointer 83/134483/2 accepted/tizen/unified/20170630.083318 submit/tizen/20170622.051018
authorDoyoun Kang <doyoun.kang@samsung.com>
Mon, 19 Jun 2017 01:49:00 +0000 (10:49 +0900)
committerJuyeon Lee <juyeonne.lee@samsung.com>
Mon, 19 Jun 2017 03:38:55 +0000 (03:38 +0000)
Change-Id: I6e2ac60d2c7b4614b626f0f8ff73dfefc1920aeb

src/lib/ecore_drm/ecore_drm_device.c

index 8f3cafb..5fe6e8e 100644 (file)
@@ -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);