Mockingboard: fix out of bounds access. (PR #1177)

This commit is contained in:
Andrea 2023-02-05 21:03:37 +00:00 committed by GitHub
parent f03f5e0904
commit 6b176f8ff5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

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;