diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-11-02 21:29:05 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-12-29 00:10:23 +0100 |
| commit | 42010b8143e2f99b3f61e19134d0f4bf9098786d (patch) | |
| tree | 9e69380befcfedd6cfe877d4f923121021a66f89 | |
| parent | 99172cdd68309a38700a882403003e03848ab140 (diff) | |
Fix null pointer dereference if DCPOMATIC_GRAPHICS is unset and resources_path() doesn't exist.
| -rw-r--r-- | src/wx/wx_util.cc | 5 |
1 files 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(); |
