VirtualBox

Changeset 99559 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Apr 28, 2023 2:30:50 PM (20 months ago)
Author:
vboxsync
Message:

Audio: Improved range checks for audio channels (PDMAUDIO_MAX_CHANNELS).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmaudioinline.h

    r98103 r99559  
    407407DECLINLINE(void) PDMAudioPropsInit(PPDMAUDIOPCMPROPS pProps, uint8_t cbSample, bool fSigned, uint8_t cChannels, uint32_t uHz)
    408408{
     409    Assert(cChannels <= PDMAUDIO_MAX_CHANNELS);
     410
    409411    pProps->cbFrame     = cbSample * cChannels;
    410412    pProps->cbSampleX   = cbSample;
     
    429431                                     bool fLittleEndian, bool fRaw)
    430432{
     433    Assert(cChannels <= PDMAUDIO_MAX_CHANNELS);
    431434    Assert(!fRaw || cbSample == sizeof(int64_t));
    432435    pProps->cbFrame     = cbSample * cChannels;
     
    503506DECL_FORCE_INLINE(uint8_t) PDMAudioPropsChannels(PCPDMAUDIOPCMPROPS pProps)
    504507{
     508    AssertReturn(pProps->cChannelsX <= PDMAUDIO_MAX_CHANNELS, PDMAUDIO_MAX_CHANNELS);
    505509    return pProps->cChannelsX;
    506510}
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