YM2608: fix possible crash

This commit is contained in:
tildearrow 2024-10-20 18:10:57 -05:00
parent 8c2b3ba438
commit 48aa3b438f

View file

@ -487,11 +487,11 @@ void DivPlatformYM2608::acquire_ymfm(short** buf, size_t len) {
ssge->get_last_out(ssgOut);
for (int i=(6+isCSM); i<(9+isCSM); i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-6]<<1;
oscBuf[i]->data[oscBuf[i]->needle++]=ssgOut.data[i-6-isCSM]<<1;
}
for (int i=(9+isCSM); i<(15+isCSM); i++) {
oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-9]->get_last_out(0)+adpcmAChan[i-9]->get_last_out(1))>>1;
oscBuf[i]->data[oscBuf[i]->needle++]=(adpcmAChan[i-9-isCSM]->get_last_out(0)+adpcmAChan[i-9]->get_last_out(1))>>1;
}
oscBuf[15+isCSM]->data[oscBuf[15+isCSM]->needle++]=(abe->get_last_out(0)+abe->get_last_out(1))>>1;