S3M/IT/XM import: hardening
This commit is contained in:
parent
6b2c010afa
commit
6449bc9af2
3 changed files with 32 additions and 10 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue