Fix svace issue 15/263515/1 upgrade_2.0.14 accepted/tizen/6.5/unified/20211028.224844 accepted/tizen/unified/20210906.123705 submit/tizen/20210906.013721 submit/tizen_6.5/20211028.163301 tizen_6.5.m2_release
authorhuiyu.eun <huiyu.eun@samsung.com>
Mon, 6 Sep 2021 01:33:55 +0000 (10:33 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Mon, 6 Sep 2021 01:33:55 +0000 (10:33 +0900)
add null checker

Change-Id: I0baf60e52dc19adb9194d5b6760c0bcd2af06dfc
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
src/video/tizen/SDL_tizenmouse.c

index b762c82..901d05c 100755 (executable)
@@ -300,6 +300,11 @@ _tizen_cb_event_mousedown_change(void *data, int type, void *event)
 
     ew = ecore_wl2_display_window_find(wl2_display, e->window);
     window = Tizen_FindWindow(_this, ew);
+    if (!window)
+    {
+        SDL_Log("SDL_Window is null");
+        return ECORE_CALLBACK_PASS_ON;
+    }
 
     int x = 0, y = 0;
     _tizen_get_mouseXY(window, (int)e->x, (int)e->y, &x, &y);
@@ -336,7 +341,11 @@ _tizen_cb_event_mouseup_change(void *data, int type, void *event)
 
     ew = ecore_wl2_display_window_find(wl2_display, e->window);
     window = Tizen_FindWindow(_this, ew);
-
+    if (!window)
+    {
+        SDL_Log("SDL_Window is null");
+        return ECORE_CALLBACK_PASS_ON;
+    }
     SDL_VideoData* videoData = SDL_GetVideoDevice()->driverdata;
     SDL_WindowData *wind = window->driverdata;
 
@@ -369,7 +378,11 @@ _tizen_cb_event_mousemove_change(void *data, int type, void *event)
 
     ew = ecore_wl2_display_window_find(wl2_display, e->window);
     window = Tizen_FindWindow(_this, ew);
-
+    if (!window)
+    {
+        SDL_Log("SDL_Window is null");
+        return ECORE_CALLBACK_PASS_ON;
+    }
     int x = 0, y = 0;
     _tizen_get_mouseXY(window, (int)e->x, (int)e->y, &x, &y);
     SDL_SendMouseMotion(window, 0, 0, x, y);
@@ -391,7 +404,11 @@ _tizen_cb_event_mouse_in(void *data, int type EINA_UNUSED, void *event)
     ev = event;
     ew = ecore_wl2_display_window_find(wl2_display, ev->window);
     window = Tizen_FindWindow(_this, ew);
-
+    if (!window)
+    {
+        SDL_Log("SDL_Window is null");
+        return ECORE_CALLBACK_PASS_ON;
+    }
     SDL_SetMouseFocus(window);
     return ECORE_CALLBACK_PASS_ON;
 }