Atrac: Validate loop end and return an error.

This commit is contained in:
Unknown W. Brackets committed 2015-10-25 17:04:23 -07:00
1 parent 9ea765a347
commit 2e5f8d687f
1 file changed
+6
+6
View File
@@ -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;
}