VirtualBox

Changeset 8297 in vbox


Ignore:
Timestamp:
Apr 22, 2008 2:30:50 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
30051
Message:

Make the vmdk format error checking tighter and fix an annoying gcc warning (only for some gcc versions).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Storage/VmdkHDDCore.cpp

    r8229 r8297  
    33273327    if (pExtent->pRGD)
    33283328        uRGTSector = pExtent->pRGD[uGDIndex];
     3329    else
     3330        uRGTSector = 0; /**< avoid compiler warning */
    33293331    if (!uGTSector)
    33303332    {
     
    33593361        if (pExtent->pRGD)
    33603362        {
     3363            AssertReturn(!uRGTSector, VERR_VDI_INVALID_HEADER);
    33613364            rc = RTFileGetSize(pExtent->File, &cbExtentSize);
    33623365            if (VBOX_FAILURE(rc))
     
    33643367            Assert(!(cbExtentSize % 512));
    33653368            uRGTSector = VMDK_BYTE2SECTOR(cbExtentSize);
     3369            /* Normally the redundant grain table is preallocated for hosted
     3370             * sparse extents that support more than 32 bit sector numbers. So
     3371             * this shouldn't ever happen on a valid extent. */
     3372            if (uRGTSector > UINT32_MAX)
     3373                return VERR_VDI_INVALID_HEADER;
    33663374            /* Write backup grain table by writing the required number of grain
    33673375             * table cache chunks. Avoids dynamic memory allocation, but is a
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