VirtualBox

Changeset 102279 in vbox for trunk


Ignore:
Timestamp:
Nov 23, 2023 4:34:33 PM (15 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10513: UIAdvancedSettingsDialog: Forgot to properly init page ID in r160198; This can cause crash in certain cases since ID == 0 is wrong; Added a bit of protection in crashed place as well.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/UIAdvancedSettingsDialog.cpp

    r102262 r102279  
    614614    , m_fSerializationClean(false)
    615615    , m_fClosed(false)
    616     , m_iPageId(0)
     616    , m_iPageId(MachineSettingsPageType_Invalid)
    617617    , m_pStatusBar(0)
    618618    , m_pProcessBar(0)
     
    669669    iPosition -= iT;
    670670    /* And actual page position according to parent: */
    671     const QPoint pnt = m_frames.value(m_iPageId)->pos();
    672     iPosition += pnt.y();
     671    UISettingsPageFrame *pFrame = m_frames.value(m_iPageId, 0);
     672    AssertPtr(pFrame);
     673    if (pFrame)
     674    {
     675        const QPoint pnt = pFrame->pos();
     676        iPosition += pnt.y();
     677    }
    673678    /* Make sure corresponding page is visible: */
    674679    m_pScrollArea->requestVerticalScrollBarPosition(iPosition);
     
    949954                                       int iParentId /* = -1 */)
    950955{
     956    /* Init m_iPageId if we haven't yet: */
     957    if (m_iPageId == MachineSettingsPageType_Invalid)
     958        m_iPageId = cId;
     959
    951960    /* Add new selector item: */
    952961    if (m_pSelector->addItem(strBigIcon, strMediumIcon, strSmallIcon,
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette