VirtualBox

Changeset 37191 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 24, 2011 5:47:47 AM (14 years ago)
Author:
vboxsync
Message:

Audio/HDA: takes alignment into account, when restoring v1 snapshots. (xTracker/5704)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevCodec.cpp

    r37190 r37191  
    18361836}
    18371837
    1838 static DECLCALLBACK(int)codecLoadV1(PCODECState pCodecState, PSSMHANDLE pSSMHandle, size_t cbOffset)
    1839 {
    1840     size_t cbRawNodesV1 = (sizeof(CODECNODE) + cbOffset) * pCodecState->cTotalNodes;
     1838static DECLCALLBACK(int)codecLoadV1(PCODECState pCodecState, PSSMHANDLE pSSMHandle, size_t cbOffset, size_t alignment)
     1839{
     1840    size_t cbRawNodesV1 = (sizeof(CODECNODE) + cbOffset + alignment) * pCodecState->cTotalNodes;
    18411841    uint8_t *pu8RawNodesV1 = (uint8_t *)RTMemAlloc(cbRawNodesV1);
    18421842    uint8_t *pu8NodeV1 = NULL;
     
    18561856        pCodecState->pNodes[idxNode].node.id = pu8NodeV1[0];
    18571857        memcpy(pCodecState->pNodes[idxNode].node.au32F00_param,
    1858                pu8NodeV1 + RT_OFFSETOF(CODECCOMMONNODE, au32F00_param),
     1858               pu8NodeV1 + RT_OFFSETOF(CODECCOMMONNODE, au32F00_param) + alignment,
    18591859               sizeof(CODECNODE) - RT_OFFSETOF(CODECCOMMONNODE,au32F00_param));
    18601860        pu8NodeV1 += sizeof(CODECNODE) + cbOffset;
     
    18721872#if RT_ARCH_X86
    18731873        if (SSMR3HandleHostBits(pSSMHandle) == 32)
    1874             rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(long));
     1874            rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(long), 0);
    18751875        else
    1876             rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(uint64_t));
     1876            rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(uint64_t), 4);
    18771877#else
    18781878        if (SSMR3HandleHostBits(pSSMHandle) == 64)
    1879             rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(long));
     1879            rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(long), 4);
    18801880        else
    1881             rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(uint32_t));
     1881            rc = codecLoadV1(pCodecState, pSSMHandle, sizeof(uint32_t), 0);
    18821882#endif
    18831883    }
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