VirtualBox

Changeset 103528 in vbox for trunk/src/VBox/Storage/VDI.cpp


Ignore:
Timestamp:
Feb 22, 2024 11:29:39 AM (9 months ago)
Author:
vboxsync
Message:

Storage/VHD.cpp,VDI.cpp: Build fixes, bugref:3409

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/VDI.cpp

    r103524 r103528  
    16431643    else if (pImage->paBlocks[uBlock] == VDI_IMAGE_BLOCK_ZERO)
    16441644    {
    1645         size_t cbSet;
    1646 
    1647         cbSet = vdIfIoIntIoCtxSet(pImage->pIfIo, pIoCtx, 0, cbToRead);
     1645        size_t cbSet = vdIfIoIntIoCtxSet(pImage->pIfIo, pIoCtx, 0, cbToRead);
    16481646        Assert(cbSet == cbToRead); RT_NOREF(cbSet);
    16491647    }
     
    28212819        {
    28222820            unsigned const cbBlock = getImageBlockSize(&pImage->Header);
    2823             size_t const cbPreAllocated = offDiscard % cbBlock;
     2821            size_t const cbPreAllocated = offDiscard % RT_MAX(cbBlock, 1); /* MSVC thinks it is clever and says there is a potential mod by 0 here, hence the RT_MAX... */
    28242822            size_t const cbPostAllocated = getImageBlockSize(&pImage->Header) - cbDiscard - cbPreAllocated;
    28252823            uint8_t *pbBlockData;
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