limit max sample size when loading .dmf
This commit is contained in:
parent
2b064f85bb
commit
732383c036
|
|
@ -910,7 +910,8 @@ bool DivEngine::loadDMF(unsigned char* file, size_t len) {
|
||||||
int vol=50;
|
int vol=50;
|
||||||
short* data;
|
short* data;
|
||||||
unsigned char* adpcmData;
|
unsigned char* adpcmData;
|
||||||
if (length<0) {
|
// I don't think a sample can be that big
|
||||||
|
if (length<0 || length>(1<<29L)) {
|
||||||
logE("invalid sample length %d. are we doing something wrong?",length);
|
logE("invalid sample length %d. are we doing something wrong?",length);
|
||||||
lastError="file is corrupt or unreadable at samples";
|
lastError="file is corrupt or unreadable at samples";
|
||||||
delete[] file;
|
delete[] file;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue