OPL: fix crash

This commit is contained in:
tildearrow 2022-06-29 02:11:25 -05:00
parent 6fe7e638d5
commit 0a055ff85b
2 changed files with 4 additions and 4 deletions

View file

@ -1800,7 +1800,7 @@ void DivPlatformOPL::setFlags(unsigned int flags) {
break;
}
for (int i=0; i<18; i++) {
for (int i=0; i<20; i++) {
oscBuf[i]->rate=rate;
}
}
@ -1851,7 +1851,7 @@ int DivPlatformOPL::init(DivEngine* p, int channels, int sugRate, unsigned int f
for (int i=0; i<20; i++) {
isMuted[i]=false;
}
for (int i=0; i<18; i++) {
for (int i=0; i<20; i++) {
oscBuf[i]=new DivDispatchOscBuffer;
}
setFlags(flags);
@ -1869,7 +1869,7 @@ int DivPlatformOPL::init(DivEngine* p, int channels, int sugRate, unsigned int f
}
void DivPlatformOPL::quit() {
for (int i=0; i<18; i++) {
for (int i=0; i<20; i++) {
delete oscBuf[i];
}
if (adpcmChan>=0) {

View file

@ -75,7 +75,7 @@ class DivPlatformOPL: public DivDispatch {
}
};
Channel chan[20];
DivDispatchOscBuffer* oscBuf[18];
DivDispatchOscBuffer* oscBuf[20];
bool isMuted[20];
struct QueuedWrite {
unsigned short addr;