GUI: fix #400
This commit is contained in:
parent
28af57c4f0
commit
9eb9561b53
4 changed files with 26 additions and 1 deletions
|
|
@ -1428,6 +1428,10 @@ bool DivEngine::addWaveFromFile(const char* path) {
|
|||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
if (len==(SIZE_MAX>>1)) {
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
if (len==0) {
|
||||
fclose(f);
|
||||
return false;
|
||||
|
|
@ -1620,6 +1624,14 @@ int DivEngine::addSampleFromFile(const char* path) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (len==(SIZE_MAX>>1)) {
|
||||
fclose(f);
|
||||
BUSY_END;
|
||||
lastError="file is invalid!";
|
||||
delete sample;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fseek(f,0,SEEK_SET)<0) {
|
||||
fclose(f);
|
||||
BUSY_END;
|
||||
|
|
|
|||
|
|
@ -1220,6 +1220,11 @@ std::vector<DivInstrument*> DivEngine::instrumentFromFile(const char* path) {
|
|||
fclose(f);
|
||||
return ret;
|
||||
}
|
||||
if (len==(SIZE_MAX>>1)) {
|
||||
lastError=strerror(errno);
|
||||
fclose(f);
|
||||
return ret;
|
||||
}
|
||||
if (len==0) {
|
||||
lastError=strerror(errno);
|
||||
fclose(f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue