mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 10:40:01 +01:00
Atrac: Validate loop end and return an error.
This commit is contained in:
1 parent
9ea765a347
commit
2e5f8d687f
1 file changed
+6
@@ -716,6 +716,12 @@ int Atrac::Analyze() {
|
||||
endSample = (dataChunkSize / atracBytesPerFrame) * atracSamplesPerFrame;
|
||||
}
|
||||
|
||||
int firstOffsetExtra = codecType == PSP_CODEC_AT3PLUS ? 368 : 69;
|
||||
if (loopEndSample != -1 && loopEndSample + firstOffsetExtra >= endSample) {
|
||||
WARN_LOG_REPORT(ME, "Atrac loop after end of data");
|
||||
return ATRAC_ERROR_BAD_CODEC_PARAMS;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user