VirtualBox

Changeset 70022 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Dec 8, 2017 12:26:01 PM (7 years ago)
Author:
vboxsync
Message:

Audio/Common: Check if the .WAV file data header is around (it's only valid when a file actually has been created).

File:
1 edited

Legend:

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

    r70014 r70022  
    13451345        {
    13461346            PAUDIOWAVFILEDATA pData = (PAUDIOWAVFILEDATA)pFile->pvData;
    1347             AssertPtr(pData);
    1348 
    1349             /* Update the header with the current data size. */
    1350             RTFileWriteAt(pFile->hFile, 0, &pData->Hdr, sizeof(pData->Hdr), NULL);
     1347            if (pData) /* The .WAV file data only is valid when a file actually has been created. */
     1348            {
     1349                /* Update the header with the current data size. */
     1350                RTFileWriteAt(pFile->hFile, 0, &pData->Hdr, sizeof(pData->Hdr), NULL);
     1351            }
    13511352
    13521353            rc = RTFileClose(pFile->hFile);
     
    14211422    {
    14221423        PAUDIOWAVFILEDATA pData = (PAUDIOWAVFILEDATA)pFile->pvData;
    1423         AssertPtr(pData);
    1424 
    1425         cbSize = pData->Hdr.u32Size2;
     1424        if (pData) /* The .WAV file data only is valid when a file actually has been created. */
     1425            cbSize = pData->Hdr.u32Size2;
    14261426    }
    14271427
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