VirtualBox

Changeset 90778 in vbox for trunk/src/VBox/Devices/Audio


Ignore:
Timestamp:
Aug 23, 2021 8:55:48 AM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146412
Message:

DrvhostAudioWasApi: Deal with PKEY_AudioEngine_DeviceFormat returning a NULL pointer. ticketref:20516

File:
1 edited

Legend:

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

    r89765 r90778  
    15221522                {
    15231523                    WAVEFORMATEX const * const pFormat = (WAVEFORMATEX const *)VarFormat.blob.pBlobData;
    1524                     AssertPtr(pFormat);
     1524                    AssertPtr(pFormat); /* Observed sometimes being NULL on windows 7 sp1. */
    15251525
    15261526                    /*
     
    15401540                            pDev->Core.fFlags = enmType == eRender ? PDMAUDIOHOSTDEV_F_DEFAULT_OUT : PDMAUDIOHOSTDEV_F_DEFAULT_IN;
    15411541                        if (enmType == eRender)
    1542                             pDev->Core.cMaxOutputChannels = pFormat->nChannels;
     1542                            pDev->Core.cMaxOutputChannels = RT_VALID_PTR(pFormat) ? pFormat->nChannels : 2;
    15431543                        else
    1544                             pDev->Core.cMaxInputChannels  = pFormat->nChannels;
     1544                            pDev->Core.cMaxInputChannels  = RT_VALID_PTR(pFormat) ? pFormat->nChannels : 1;
    15451545
    15461546                        memcpy(pDev->wszDevId, pwszDevId, cwcDevId * sizeof(RTUTF16));
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