VirtualBox

Changeset 33191 in vbox for trunk/src/VBox/Devices/Storage


Ignore:
Timestamp:
Oct 18, 2010 11:49:38 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
66728
Message:

Storage/VMDK: fix conditions for reading VMDK footer (regression)

File:
1 edited

Legend:

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

    r33190 r33191  
    27162716    int rc;
    27172717
    2718     if (fMagicAlreadyRead)
     2718    if (!fMagicAlreadyRead)
    27192719        rc = vmdkFileReadSync(pImage, pExtent->pFile, 0, &Header,
    27202720                              sizeof(Header), NULL);
     
    27592759        pExtent->uAppendPosition = RT_ALIGN_64(cbFile, 512);
    27602760
    2761     if (   !(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
    2762         || (   pExtent->fFooter
    2763             && !(pImage->uOpenFlags & VD_OPEN_FLAGS_SEQUENTIAL)))
     2761    if (   pExtent->fFooter
     2762        && (   !(pImage->uOpenFlags & VD_OPEN_FLAGS_READONLY)
     2763            || !(pImage->uOpenFlags & VD_OPEN_FLAGS_SEQUENTIAL)))
    27642764    {
    27652765        /* Read the footer, which comes before the end-of-stream marker. */
     
    32903290            goto out;
    32913291        }
    3292         rc = vmdkReadBinaryMetaExtent(pImage, pExtent, false /* fMagicAlreadyRead */);
     3292        rc = vmdkReadBinaryMetaExtent(pImage, pExtent, true /* fMagicAlreadyRead */);
    32933293        if (RT_FAILURE(rc))
    32943294            goto out;
     
    34823482                    }
    34833483                    rc = vmdkReadBinaryMetaExtent(pImage, pExtent,
    3484                                                   true /* fMagicAlreadyRead */);
     3484                                                  false /* fMagicAlreadyRead */);
    34853485                    if (RT_FAILURE(rc))
    34863486                        goto out;
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