mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-13 09:39:33 +01:00
Merge pull request #2055 from oioitff/atrac-fix
fix a tiny bug for atrac crash
This commit is contained in:
commit
3cc91a71e1
1 file changed
+2
-2
@@ -541,9 +541,9 @@ u32 sceAtracDecodeData(int atracID, u32 outAddr, u32 numSamplesAddr, u32 finishF
|
||||
if (atrac->sampleQueue.getQueueSize() < ATRAC_MAX_SAMPLES * sizeof(s16) * atrac->atracChannels) {
|
||||
int decodebytes = 0;
|
||||
atrac->decodePos = atrac->getDecodePosBySample(atrac->currentSample);
|
||||
int inbytes = std::max((int)atrac->first.filesize - (int)atrac->decodePos, 0);
|
||||
int inbytes = std::max((int)atrac->first.size - (int)atrac->decodePos, 0);
|
||||
inbytes = std::min(inbytes, (int)atrac->atracBytesPerFrame);
|
||||
if (inbytes > 0) {
|
||||
if (inbytes > 0 && inbytes == atrac->atracBytesPerFrame) {
|
||||
Atrac3plus_Decoder::Decode(atrac->decoder_context, atrac->data_buf + atrac->decodePos, inbytes, &decodebytes, buf);
|
||||
DEBUG_LOG(HLE, "decodebytes: %i outbuf: %p", decodebytes, buf);
|
||||
atrac->sampleQueue.push(buf, decodebytes);
|
||||
|
||||
Reference in new issue
Block a user