S3M/IT/XM import: hardening

This commit is contained in:
tildearrow 2024-07-01 05:44:28 -05:00
parent 6b2c010afa
commit 6449bc9af2
3 changed files with 32 additions and 10 deletions

View file

@ -414,7 +414,12 @@ bool DivEngine::loadS3M(unsigned char* file, size_t len) {
unsigned int length=reader.readI();
logV("length: %x",length);
if (length>16777216) {
logE("abnormal sample size! %x",reader.tell());
lastError="bad sample size";
delete[] file;
return false;
}
DivSample* s=new DivSample;