VirtualBox

Ignore:
Timestamp:
Apr 7, 2018 10:33:03 PM (7 years ago)
Author:
vboxsync
Message:

DevSB16: Fixed initialization order so we don't crash in sb16Destruct on invalid config. (how many times to I have to fix this?)

File:
1 edited

Legend:

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

    r71742 r71744  
    24952495
    24962496    /*
     2497     * Initialize the data so sb16Destruct runs without a hitch if we return early.
     2498     */
     2499    pThis->pDevInsR3               = pDevIns;
     2500    pThis->IBase.pfnQueryInterface = sb16QueryInterface;
     2501    pThis->cmd                     = -1;
     2502
     2503    pThis->csp_regs[5]             = 1;
     2504    pThis->csp_regs[9]             = 0xf8;
     2505
     2506    RTListInit(&pThis->lstDrv);
     2507
     2508    /*
    24972509     * Validations.
    24982510     */
     
    25422554        return PDMDEV_SET_ERROR(pDevIns, rc,
    25432555                                N_("SB16 configuration error: Failed to get the \"Version\" value"));
     2556    pThis->ver     = u16Version;
     2557    pThis->verCfg  = u16Version;
    25442558
    25452559#ifndef VBOX_WITH_AUDIO_SB16_CALLBACKS
     
    25512565#endif
    25522566
    2553     pThis->ver     = u16Version;
    2554     pThis->verCfg  = u16Version;
    2555 
    25562567    /*
    2557      * Init instance data.
     2568     * Setup the mixer now that we've got the irq and dma channel numbers.
    25582569     */
    2559     pThis->pDevInsR3               = pDevIns;
    2560     pThis->IBase.pfnQueryInterface = sb16QueryInterface;
    2561     pThis->cmd                     = -1;
    2562 
    2563     pThis->mixer_regs[0x80]        = magic_of_irq (pThis->irq);
    2564     pThis->mixer_regs[0x81]        = (1 << pThis->dma) | (1 << pThis->hdma);
    2565     pThis->mixer_regs[0x82]        = 2 << 5;
    2566 
    2567     pThis->csp_regs[5]             = 1;
    2568     pThis->csp_regs[9]             = 0xf8;
    2569 
    2570     RTListInit(&pThis->lstDrv);
     2570    pThis->mixer_regs[0x80] = magic_of_irq(pThis->irq);
     2571    pThis->mixer_regs[0x81] = (1 << pThis->dma) | (1 << pThis->hdma);
     2572    pThis->mixer_regs[0x82] = 2 << 5;
    25712573
    25722574    sb16MixerReset(pThis);
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