From bafb23edc3e9b3129db59371801ea6633bffb05b Mon Sep 17 00:00:00 2001 From: Dwedit Date: Wed, 9 May 2018 19:25:33 -0500 Subject: [PATCH] Additional null check in video_driver.c I have managed to trigger a null pointer exception on one of these two functions, so for safety, I added in null checks for the structs and function pointers. --- gfx/video_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 1776954fef..83bc921c5b 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -564,12 +564,12 @@ const video_poke_interface_t *video_driver_get_poke(void) static bool video_context_has_focus(void) { - return current_video_context.has_focus(video_context_data); + return current_video_context.has_focus && current_video_context.has_focus(video_context_data); } static bool video_driver_has_focus(void) { - return current_video->focus(video_driver_data); + return current_video && current_video->focus && current_video->focus(video_driver_data); } static bool null_driver_has_focus(void)