forked from rosebudai/OpenRCT2-Web
Guard bottom toolbar resizing to prevent nullptr deref (#26994)
This commit is contained in:
1 parent
79be249f71
commit
63a787c2ae
1 file changed
+7
-1
@@ -763,12 +763,18 @@ static constexpr float kWindowScrollLocations[][2] = {
|
||||
}
|
||||
|
||||
WindowBase* bottomWind = windowMgr->FindByClass(WindowClass::bottomToolbar);
|
||||
if (bottomWind != nullptr)
|
||||
if (bottomWind != nullptr && parkInfoPanel != nullptr && dateInfoPanel != nullptr)
|
||||
{
|
||||
bottomWind->width = std::max(640, width) - parkInfoPanel->width - dateInfoPanel->width;
|
||||
bottomWind->windowPos.x = parkInfoPanel->width;
|
||||
bottomWind->windowPos.y = height - 32;
|
||||
}
|
||||
else if (bottomWind != nullptr)
|
||||
{
|
||||
bottomWind->width = std::max(640, width);
|
||||
bottomWind->windowPos.x = 0;
|
||||
bottomWind->windowPos.y = height - 32;
|
||||
}
|
||||
}
|
||||
|
||||
static void WindowResizeGuiTitleScreen(const int32_t width, const int32_t height)
|
||||
|
||||
Reference in new issue
Block a user