VirtualBox

Changeset 68797 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Sep 20, 2017 10:26:24 AM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
118044
Message:

VideoRec/DrvAudioVideoRec: Added some more checks + assertions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/DrvAudioVideoRec.cpp

    r68772 r68797  
    330330            case AVRECCONTAINERTYPE_MAIN_CONSOLE:
    331331            {
    332                 pSink->Con.Main.pConsole = pThis->pConsole;
     332                if (pThis->pConsole)
     333                {
     334                    pSink->Con.Main.pConsole = pThis->pConsole;
     335                }
     336                else
     337                    rc = VERR_NOT_SUPPORTED;
    333338                break;
    334339            }
     
    10191024    RT_NOREF(fFlags);
    10201025
     1026    AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
     1027    AssertPtrReturn(pCfg,    VERR_INVALID_POINTER);
     1028
    10211029    PDMDRV_CHECK_VERSIONS_RETURN(pDrvIns);
    10221030    PDRVAUDIOVIDEOREC pThis = PDMINS_2_DATA(pDrvIns, PDRVAUDIOVIDEOREC);
    1023 
    1024     AssertPtrReturn(pDrvIns, VERR_INVALID_POINTER);
    1025     AssertPtrReturn(pCfg, VERR_INVALID_POINTER);
    10261031
    10271032    LogRel(("Audio: Initializing video recording audio driver\n"));
     
    10461051    void *pvUser;
    10471052    int rc = CFGMR3QueryPtr(pCfg, "ObjectConsole", &pvUser); /** @todo r=andy Get rid of this hack and use IHostAudio::SetCallback. */
    1048     AssertMsgRCReturn(rc, ("Confguration error: No/bad \"ObjectConsole\" value, rc=%Rrc\n", rc), rc);
     1053    AssertRCReturn(rc, rc);
    10491054
    10501055    /* CFGM tree saves the pointer to Console in the Object node of AudioVideoRec. */
    10511056    pThis->pConsole = (Console *)pvUser;
     1057    AssertReturn(!pThis->pConsole.isNull(), VERR_INVALID_POINTER);
    10521058
    10531059    /*
     
    10551061     */
    10561062    rc = CFGMR3QueryPtr(pCfg, "Object", &pvUser); /** @todo r=andy Get rid of this hack and use IHostAudio::SetCallback. */
    1057     AssertMsgRCReturn(rc, ("Confguration error: No/bad \"Object\" value, rc=%Rrc\n", rc), rc);
     1063    AssertRCReturn(rc, rc);
    10581064
    10591065    pThis->pAudioVideoRec = (AudioVideoRec *)pvUser;
     1066    AssertPtrReturn(pThis->pAudioVideoRec, VERR_INVALID_POINTER);
     1067
    10601068    pThis->pAudioVideoRec->mpDrv = pThis;
    10611069
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