Fix crash when low level decode hits atrac3 audio

This commit is contained in:
raven02 2013-05-24 23:20:14 +08:00
parent 0fc087ffac
commit 84ccfde2ef

View File

@ -1343,9 +1343,6 @@ int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesConsumedA
WARN_LOG(HLE, "This is an atrac3+ stereo audio (low level)");
initAT3plusDecoder(atrac);
}
} else if (atrac->codeType == PSP_MODE_AT_3) {
WARN_LOG(HLE, "This is an atrac3 audio (low level)");
}
int headersize = sizeof(at3plusHeader);
atrac->first.filesize = (*(u32*)(at3plusHeader + 4)) + 8;
atrac->data_buf = new u8[atrac->first.filesize];
@ -1356,6 +1353,9 @@ int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesConsumedA
atrac->first.size = headersize + atrac->atracBytesPerFrame;
atrac->first.fileoffset = atrac->first.size;
addAtrac3Audio(atrac->data_buf, atrac->atracChannels == 2 ? atrac->first.size : atrac->first.filesize, atracID);
} else if (atrac->codeType == PSP_MODE_AT_3) {
WARN_LOG(HLE, "This is an atrac3 audio (low level)");
}
}
else {
audioEngine *engine = getaudioEngineByID(atracID);