fix crash when adding/cloning more than 32 chips
This commit is contained in:
parent
fb16897e76
commit
9c42d3a7b3
|
@ -1095,7 +1095,7 @@ bool DivEngine::changeSystem(int index, DivSystem which, bool preserveOrder) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DivEngine::addSystem(DivSystem which) {
|
bool DivEngine::addSystem(DivSystem which) {
|
||||||
if (song.systemLen>DIV_MAX_CHIPS) {
|
if (song.systemLen>=DIV_MAX_CHIPS) {
|
||||||
lastError=fmt::sprintf("max number of systems is %d",DIV_MAX_CHIPS);
|
lastError=fmt::sprintf("max number of systems is %d",DIV_MAX_CHIPS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1149,7 +1149,7 @@ bool DivEngine::duplicateSystem(int index, bool pat, bool end) {
|
||||||
lastError="invalid index";
|
lastError="invalid index";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (song.systemLen>DIV_MAX_CHIPS) {
|
if (song.systemLen>=DIV_MAX_CHIPS) {
|
||||||
lastError=fmt::sprintf("max number of systems is %d",DIV_MAX_CHIPS);
|
lastError=fmt::sprintf("max number of systems is %d",DIV_MAX_CHIPS);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue