From 91d64b1042e91cf90e05e94d7cb4c1389afd8db5 Mon Sep 17 00:00:00 2001 From: Toni Neubert Date: Thu, 5 Sep 2024 04:51:59 +0200 Subject: [PATCH] fix(sdl): check against NULL before using the driver data of a display (#6799) --- src/drivers/sdl/lv_sdl_window.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/sdl/lv_sdl_window.c b/src/drivers/sdl/lv_sdl_window.c index 7147c096a..df8a28e4e 100644 --- a/src/drivers/sdl/lv_sdl_window.c +++ b/src/drivers/sdl/lv_sdl_window.c @@ -166,7 +166,7 @@ lv_display_t * lv_sdl_get_disp_from_win_id(uint32_t win_id) while(disp) { lv_sdl_window_t * dsc = lv_display_get_driver_data(disp); - if(SDL_GetWindowID(dsc->window) == win_id) { + if(dsc != NULL && SDL_GetWindowID(dsc->window) == win_id) { return disp; } disp = lv_display_get_next(disp);