VirtualBox

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


Ignore:
Timestamp:
Dec 16, 2019 4:37:11 PM (5 years ago)
Author:
vboxsync
Message:

AudioMixer: Fix for regression from r135308. Must not forget to NULL pSink->In.pStreamRecSource when pStream is NULL, or we'll end up trying to use pConn after it has be set to NULL and the structure freed. bugref:9625

File:
1 edited

Legend:

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

    r82581 r82588  
    15021502    if (RT_SUCCESS(rc))
    15031503    {
    1504         if (pStream) /* Can be NULL if un-setting. */
     1504        if (pStream)
    15051505        {
    15061506            AssertPtr(pStream->pStream);
     
    15091509            rc = pStream->pConn->pfnEnable(pStream->pConn, PDMAUDIODIR_IN, true /* Enable */);
    15101510            if (RT_SUCCESS(rc))
    1511             {
    15121511                pSink->In.pStreamRecSource = pStream;
    1513             }
    15141512            else if (pSink->In.pStreamRecSource->pConn) /* Stay with the current recording source (if any) and re-enable it. */
    15151513            {
     
    15191517            }
    15201518        }
     1519        else
     1520            pSink->In.pStreamRecSource = NULL; /* Unsetting, see audioMixerSinkRemoveStreamInternal. */
    15211521    }
    15221522
     
    15251525
    15261526    if (RT_SUCCESS(rc))
    1527     {
    15281527        LogRel(("Audio Mixer: Setting recording source of sink '%s' to '%s'\n",
    15291528                pSink->pszName, pSink->In.pStreamRecSource ? pSink->In.pStreamRecSource->pszName : "<None>"));
    1530     }
    15311529    else if (rc != VERR_AUDIO_STREAM_NOT_READY)
    1532     {
    15331530        LogRel(("Audio Mixer: Setting recording source of sink '%s' to '%s' failed with %Rrc\n",
    15341531                pSink->pszName, pSink->In.pStreamRecSource ? pSink->In.pStreamRecSource->pszName : "<None>", rc));
    1535     }
    15361532
    15371533    return rc;
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