VirtualBox

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


Ignore:
Timestamp:
Oct 9, 2019 12:11:53 PM (5 years ago)
Author:
vboxsync
Message:

Audio/HDA: Added more codec verb checks (bugref:9569).

Location:
trunk/src/VBox/Devices/Audio
Files:
3 edited

Legend:

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

    r81181 r81182  
    13131313        LogFunc(("[SD%RU8] Warning: Invalid stream tag %RU8 specified!\n", uSD, uTag));
    13141314
    1315         int rc = hdaRegWriteU24(pDevIns, pThis, iReg, u32Value);
    13161315        DEVHDA_UNLOCK_BOTH(pDevIns, pThis, uSD);
    1317         return rc;
     1316        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
    13181317    }
    13191318
    13201319    PHDASTREAM pStream = hdaGetStreamFromSD(pThis, uSD);
    1321     AssertPtr(pStream);
     1320    if (!pStream)
     1321    {
     1322        ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing SDCTL (0x%x) to unhandled stream #%RU8\n", u32Value, uSD));
     1323
     1324        DEVHDA_UNLOCK_BOTH(pDevIns, pThis, uSD);
     1325        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
     1326    }
    13221327
    13231328    if (fInReset)
     
    14871492    if (!pStream)
    14881493    {
    1489         AssertMsgFailed(("[SD%RU8] Warning: Writing SDSTS on non-attached stream (0x%x)\n",
    1490                          HDA_SD_NUM_FROM_REG(pThis, STS, iReg), u32Value));
    1491 
    1492         int rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
     1494        ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing SDSTS (0x%x) to unhandled stream #%RU8\n", u32Value, uSD));
    14931495        DEVHDA_UNLOCK_BOTH(pDevIns, pThis, uSD);
    1494         return rc;
     1496        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
    14951497    }
    14961498
     
    16491651    if (!pStream)
    16501652    {
    1651         AssertMsgFailed(("[SD%RU8] Warning: Changing FIFOW on non-attached stream (0x%x)\n", uSD, u32Value));
    1652 
    1653         int rc = hdaRegWriteU16(pDevIns, pThis, iReg, u32Value);
    16541653        DEVHDA_UNLOCK(pDevIns, pThis);
    1655         return rc;
     1654        return VINF_SUCCESS; /* Always return success to the MMIO handler. */
    16561655    }
    16571656
     
    16661665            break;
    16671666        default:
    1668             ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried write unsupported FIFOW (0x%x) to stream #%RU8, defaulting to 32 bytes\n",
     1667            ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing unsupported FIFOW (0x%x) to stream #%RU8, defaulting to 32 bytes\n",
    16691668                                            u32Value, uSD));
    16701669            u32FIFOW = HDA_SDFIFOW_32B;
     
    16961695    if (hdaGetDirFromSD(uSD) != PDMAUDIODIR_OUT) /* FIFOS for output streams only. */
    16971696    {
    1698         LogRel(("HDA: Warning: Guest tried to write read-only FIFOS to input stream #%RU8, ignoring\n", uSD));
    1699 
     1697        ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing read-only FIFOS to input stream #%RU8, ignoring\n", uSD));
    17001698        DEVHDA_UNLOCK(pDevIns, pThis);
    17011699        return VINF_SUCCESS;
     
    17161714
    17171715        default:
    1718             ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried write unsupported FIFOS (0x%x) to stream #%RU8, defaulting to 192 bytes\n",
     1716            ASSERT_GUEST_LOGREL_MSG_FAILED(("Guest tried writing unsupported FIFOS (0x%x) to stream #%RU8, defaulting to 192 bytes\n",
    17191717                                            u32Value, uSD));
    17201718            u32FIFOS = HDA_SDOFIFO_192B;
  • trunk/src/VBox/Devices/Audio/DevHDACommon.cpp

    r80692 r81182  
    2222#include <iprt/assert.h>
    2323#include <iprt/errcore.h>
     24
     25#include <VBox/AssertGuest.h>
    2426
    2527#define LOG_GROUP LOG_GROUP_DEV_HDA
     
    259261    if (uSD >= HDA_MAX_STREAMS)
    260262    {
    261         AssertMsgFailed(("Invalid / non-handled SD%RU8\n", uSD));
     263        ASSERT_GUEST_LOGREL_MSG_FAILED(("Stream #%RU8 is invalid\n", uSD));
    262264        return NULL;
    263265    }
  • trunk/src/VBox/Devices/Audio/HDACodec.cpp

    r76553 r81182  
    2424*********************************************************************************************************************************/
    2525#define LOG_GROUP LOG_GROUP_DEV_HDA_CODEC
     26#include <VBox/AssertGuest.h>
    2627#include <VBox/vmm/pdmdev.h>
    2728#include <VBox/vmm/pdmaudioifs.h>
     
    23682369    LogFlowFunc(("[NID0x%02x] Setting to stream ID=%RU8, channel=%RU8\n",
    23692370                 CODEC_NID(cmd), uSD, uChannel));
     2371
     2372    ASSERT_GUEST_LOGREL_MSG_RETURN(uSD < HDA_MAX_STREAMS,
     2373                                   ("Setting stream ID #%RU8 is invalid\n", uSD), VERR_INVALID_PARAMETER);
    23702374
    23712375    PDMAUDIODIR enmDir;
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