From fbe84d722c8db0c812ce54da012d5a6d0a72006f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 2 Nov 2025 21:29:05 +0100 Subject: Fix null pointer dereference if DCPOMATIC_GRAPHICS is unset and resources_path() doesn't exist. --- src/wx/wx_util.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/wx/wx_util.cc b/src/wx/wx_util.cc index 7d0329070..331642a13 100644 --- a/src/wx/wx_util.cc +++ b/src/wx/wx_util.cc @@ -629,15 +629,14 @@ bitmap_path (string name) #ifdef DCPOMATIC_DEBUG /* Hack to allow Linux and OS X to find icons when running from the source tree */ - char* path = getenv ("DCPOMATIC_GRAPHICS"); - if (path) { + if (char* path = getenv("DCPOMATIC_GRAPHICS")) { base = path; } else { base = resources_path(); } if (!boost::filesystem::exists(base / name)) { - base = path / boost::filesystem::path("osx/preferences"); + base /= boost::filesystem::path("osx/preferences"); } #else base = resources_path(); -- cgit v1.2.3