From bd7e357f77bbaec2b41f47e34555a2a055e9342f Mon Sep 17 00:00:00 2001 From: cutealien Date: Sat, 14 May 2022 14:03:30 +0000 Subject: [PATCH] Add checks for valid skin pointer in CGUIMenu Found with VS analyser git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6395 dfc29bdd-3216-0410-991c-e03cc46cb475 --- source/Irrlicht/CGUIMenu.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/Irrlicht/CGUIMenu.cpp b/source/Irrlicht/CGUIMenu.cpp index 37e9ec3..ce235c7 100644 --- a/source/Irrlicht/CGUIMenu.cpp +++ b/source/Irrlicht/CGUIMenu.cpp @@ -42,6 +42,9 @@ void CGUIMenu::draw() return; IGUISkin* skin = Environment->getSkin(); + if ( !skin ) + return; + IGUIFont* font = skin->getFont(EGDF_MENU); if (font != LastFont) @@ -199,6 +202,8 @@ void CGUIMenu::recalculateSize() IGUISkin* skin = Environment->getSkin(); + if ( !skin ) + return; IGUIFont* font = skin->getFont(EGDF_MENU); if (!font)