fix crash when exporting audio (per chip)

also fix two misc issues in ES5506 and Sound Unit
This commit is contained in:
tildearrow 2023-07-24 22:34:39 -05:00
parent 68a2c5f2f0
commit 4161dcd786
3 changed files with 5 additions and 3 deletions

View file

@ -927,12 +927,13 @@ void DivEngine::runExportThread() {
}
}
float* outBuf[2];
float* outBuf[DIV_MAX_OUTPUTS];
memset(outBuf,0,sizeof(void*)*DIV_MAX_OUTPUTS);
outBuf[0]=new float[EXPORT_BUFSIZE];
outBuf[1]=new float[EXPORT_BUFSIZE];
short* sysBuf[DIV_MAX_CHIPS];
for (int i=0; i<song.systemLen; i++) {
sysBuf[i]=new short[EXPORT_BUFSIZE*2];
sysBuf[i]=new short[EXPORT_BUFSIZE*disCont[i].dispatch->getOutputCount()];
}
// take control of audio output

View file

@ -1253,6 +1253,7 @@ int DivPlatformES5506::init(DivEngine* p, int channels, int sugRate, const DivCo
dumpWrites=false;
skipRegisterWrites=false;
volScale=0;
curPage=0;
for (int i=0; i<32; i++) {
isMuted[i]=false;

View file

@ -626,7 +626,7 @@ void DivPlatformSoundUnit::quit() {
delete oscBuf[i];
}
delete su;
delete sampleMem;
delete[] sampleMem;
}
DivPlatformSoundUnit::~DivPlatformSoundUnit() {