VirtualBox

Ignore:
Timestamp:
May 23, 2014 12:26:48 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
93870
Message:

FE/Qt: Runtime UI: Another try to fix QImage frame-buffer crash: Take into account contents shifting while calculating sub-image.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIFrameBufferQImage.cpp

    r51359 r51369  
    313313                    (rect.y() + iContentsShiftY) * image.bytesPerLine();
    314314
     315    /* Restrain boundaries: */
     316    int iSubImageWidth = qMin(rect.width(), image.width() - iContentsShiftX);
     317    int iSubImageHeight = qMin(rect.height(), image.height() - iContentsShiftY);
     318
    315319    /* Create sub-image (no copy involved): */
    316320    QImage subImage = QImage(image.bits() + offset,
    317                              rect.width(), rect.height(),
     321                             iSubImageWidth, iSubImageHeight,
    318322                             image.bytesPerLine(), image.format());
    319323
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