don't allow chip channel count to be set to 0
This commit is contained in:
parent
663f32d9d4
commit
f6d0979209
2 changed files with 5 additions and 1 deletions
|
|
@ -1067,6 +1067,10 @@ bool DivEngine::setSystemChans(int index, int ch, bool preserveOrder) {
|
|||
lastError=_("invalid index");
|
||||
return false;
|
||||
}
|
||||
if (ch<1) {
|
||||
lastError=_("channel count should be at least 1");
|
||||
return false;
|
||||
}
|
||||
if (song.chans-song.systemChans[index]+ch>DIV_MAX_CHANS) {
|
||||
lastError=fmt::sprintf(_("max number of total channels is %d"),DIV_MAX_CHANS);
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue