mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Merge pull request #649 from Ragora/bugfix-asan-guigamelistmenuctrl
BugFix: Correct an ASAN reported memory access error in GuiGameListMenuCtrl
This commit is contained in:
commit
efed9358f7
1 changed files with 8 additions and 4 deletions
|
|
@ -543,7 +543,8 @@ Point2I GuiGameListMenuCtrl::getMinExtent() const
|
||||||
{
|
{
|
||||||
Point2I parentMin = Parent::getMinExtent();
|
Point2I parentMin = Parent::getMinExtent();
|
||||||
|
|
||||||
GuiGameListMenuProfile * profile = (GuiGameListMenuProfile *) mProfile;
|
GuiGameListMenuProfile * profile = dynamic_cast<GuiGameListMenuProfile*>(mProfile);
|
||||||
|
AssertFatal(profile, "Invalid profile for GuiGameListMenuCtrl!");
|
||||||
|
|
||||||
S32 minHeight = 0;
|
S32 minHeight = 0;
|
||||||
S32 rowHeight = profile->getRowHeight();
|
S32 rowHeight = profile->getRowHeight();
|
||||||
|
|
@ -632,10 +633,13 @@ void GuiGameListMenuCtrl::enforceConstraints()
|
||||||
|
|
||||||
void GuiGameListMenuCtrl::updateHeight()
|
void GuiGameListMenuCtrl::updateHeight()
|
||||||
{
|
{
|
||||||
S32 minHeight = getMinExtent().y;
|
if (hasValidProfile())
|
||||||
if (getHeight() < minHeight)
|
|
||||||
{
|
{
|
||||||
setHeight(minHeight);
|
S32 minHeight = getMinExtent().y;
|
||||||
|
if (getHeight() < minHeight)
|
||||||
|
{
|
||||||
|
setHeight(minHeight);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue