VirtualBox

Changeset 89558 in vbox


Ignore:
Timestamp:
Jun 8, 2021 8:11:48 AM (3 years ago)
Author:
vboxsync
Message:

AudioMixer: Must use RTMemAllocZVar when doing variable length allocation for the mixer and sink, or the electric fence heap will misalign the blocks causing critsect trouble. bugref:9890

File:
1 edited

Legend:

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

    r89489 r89558  
    175175
    176176    int         rc;
    177     PAUDIOMIXER pMixer = (PAUDIOMIXER)RTMemAllocZ(sizeof(AUDIOMIXER) + cchName + 1);
     177    PAUDIOMIXER pMixer = (PAUDIOMIXER)RTMemAllocZVar(sizeof(AUDIOMIXER) + cchName + 1);
    178178    if (pMixer)
    179179    {
     
    379379     * Allocate the data and initialize the critsect.
    380380     */
    381     PAUDMIXSINK pSink = (PAUDMIXSINK)RTMemAllocZ(sizeof(AUDMIXSINK) + cchName + 1);
     381    PAUDMIXSINK pSink = (PAUDMIXSINK)RTMemAllocZVar(sizeof(AUDMIXSINK) + cchName + 1);
    382382    if (pSink)
    383383    {
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