From: huiyu.eun Date: Fri, 13 Aug 2021 02:31:29 +0000 (+0900) Subject: Fix svace issue X-Git-Tag: accepted/tizen/unified/20210826.123539^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d489e0e61c4014887bee2cd2b07da8f5dcc57c6;hp=c140c75488338b30aefc7bb7d35f024ac9ef532a;p=platform%2Fupstream%2FSDL.git Fix svace issue Fix 'DEREF_OF_NULL' - Add null checker Change-Id: Icb5b8a74bc652a165397df6a7d55920c3c1502e8 Signed-off-by: huiyu.eun --- diff --git a/src/video/tizen/SDL_tizenwindow.c b/src/video/tizen/SDL_tizenwindow.c index ff13b75..da12fc6 100755 --- a/src/video/tizen/SDL_tizenwindow.c +++ b/src/video/tizen/SDL_tizenwindow.c @@ -183,6 +183,12 @@ _cb_client_data(void *data, int type EINA_UNUSED, void *event) SDL_VideoData* videoData = SDL_GetVideoDevice()->driverdata; SDL_Window * window = (SDL_Window*)eina_hash_find(videoData->windows, &videoData->indicator_parent_id); + if (!window) + { + SDL_Log("window is null"); + return ECORE_CALLBACK_PASS_ON; + } + switch(epcEvent->major) { case OP_INDICATOR_INIT: @@ -517,7 +523,14 @@ _tizen_window_orientaiton_hint_callback(void *userdata, const char *name, const } } - Tizen_rotate_update(Tizen_FindWindow(SDL_GetVideoDevice(), window)); + SDL_Window *sdl_window = Tizen_FindWindow(SDL_GetVideoDevice(), window); + if (!sdl_window) + { + SDL_Log("Rotate error: sdl_window is null"); + return; + } + + Tizen_rotate_update(sdl_window); } void @@ -1297,7 +1310,17 @@ static Eina_Bool _tizen_cb_event_window_show(void *data, int type, void *event) { SDL_VideoData *this = SDL_GetVideoDevice()->driverdata; SDL_Window * window = (SDL_Window*)eina_hash_find(this->windows, &e->win); + if (!window) + { + SDL_Log("window is null"); + return ECORE_CALLBACK_PASS_ON; + } SDL_WindowData *wind = window->driverdata; + if (!wind) + { + SDL_Log("window->driverdata is null"); + return ECORE_CALLBACK_PASS_ON; + } wind->g_res_id = g_res_id; SDL_Log("[SDL] SDL Window Resource ID %d", g_res_id); }