mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-05 00:06:50 +00:00
fix(gui): avoid null-pointer UB in create_scaled_bitmap with win == nullptr create_scaled_bitmap() documents that win may be nullptr, but called win->FromDIP() on it. Calling a member function through a null pointer is undefined behavior: clang assumes `this` is non-null and deletes the subsequent `win ?` null check added in #13117, turning the fallback branch into an unconditional virtual call through a null vtable. This crashed LLVM/clang-cl builds at startup (access violation reading 0x0 in BBLTopbar creation); MSVC builds were unaffected by luck. Use the static, null-safe wxWindow::FromDIP(x, win) overload instead, which falls back to the primary display DPI. Behavior is unchanged for non-null windows.
41 KiB
41 KiB