VirtualBox

Changeset 55819 in vbox


Ignore:
Timestamp:
May 12, 2015 10:10:36 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
100260
Message:

FE/Qt: Selector UI: Details pane: VM Preview: Make sure acquired guest-screen resolution is valid.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGMachinePreview.cpp

    r54644 r55819  
    251251                    KGuestMonitorStatus monitorStatus = KGuestMonitorStatus_Enabled;
    252252                    display.GetScreenResolution(0, uGuestWidth, uGuestHeight, uBpp, iOriginX, iOriginY, monitorStatus);
     253                    if (uGuestWidth == 0 || uGuestHeight == 0)
     254                    {
     255                        AssertMsgFailed(("Acquired guest screen resolution is %dx%d\n",
     256                                         uGuestWidth, uGuestHeight));
     257                        break;
     258                    }
     259
    253260                    double dAspectRatio = (double)uGuestWidth / uGuestHeight;
    254261                    /* Look for the best aspect-ratio preset preset: */
     
    515522QSize UIGMachinePreview::imageAspectRatioSize(const QSize &hostSize, const QSize &guestSize)
    516523{
     524    /* Make sure host-size and guest-size are valid: */
     525    AssertReturn(!hostSize.isNull(), QSize());
     526    AssertReturn(!guestSize.isNull(), hostSize);
     527
    517528    /* Calculate host/guest aspect-ratio: */
    518529    const double dHostAspectRatio = (double)hostSize.width() / hostSize.height();
Note: See TracChangeset for help on using the changeset viewer.

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