Mockingboard: fix out of bounds access.

Signed-off-by: Andrea Odetti <mariofutire@gmail.com>
This commit is contained in:
Andrea Odetti 2023-02-05 18:07:23 +00:00
parent f03f5e0904
commit cc8bb21dcb

View File

@ -67,7 +67,7 @@ MockingboardCard::MockingboardCard(UINT slot, SS_CARDTYPE type) : Card(type, slo
m_lastAYUpdateCycle = 0;
for (UINT i = 0; i < NUM_VOICES; i++)
m_ppAYVoiceBuffer[NUM_VOICES] = NULL;
m_ppAYVoiceBuffer[i] = new short[MAX_SAMPLES]; // Buffer can hold a max of 0.37 seconds worth of samples (16384/44100)
m_inActiveCycleCount = 0;
m_regAccessedFlag = false;
@ -88,9 +88,6 @@ MockingboardCard::MockingboardCard(UINT slot, SS_CARDTYPE type) : Card(type, slo
m_syncEvent[id] = new SyncEvent(syncId, 0, MB_SyncEventCallback);
}
for (UINT i = 0; i < NUM_VOICES; i++)
m_ppAYVoiceBuffer[i] = new short[MAX_SAMPLES]; // Buffer can hold a max of 0.37 seconds worth of samples (16384/44100)
for (UINT i = 0; i < NUM_SUBUNITS_PER_MB; i++)
{
m_MBSubUnit[i].nAY8910Number = i;