GUI: doSelectAll() safety checks
This commit is contained in:
parent
11f0448db4
commit
ba90eafcf3
|
|
@ -273,9 +273,16 @@ void FurnaceGUI::doSelectAll() {
|
||||||
} else {
|
} else {
|
||||||
int selStartX=0;
|
int selStartX=0;
|
||||||
int selEndX=0;
|
int selEndX=0;
|
||||||
|
int chanCount=e->getTotalChannelCount();
|
||||||
// find row position
|
// find row position
|
||||||
for (SelectionPoint i; i.xCoarse!=selStart.xCoarse || i.xFine!=selStart.xFine; selStartX++) {
|
for (SelectionPoint i; i.xCoarse!=selStart.xCoarse || i.xFine!=selStart.xFine; selStartX++) {
|
||||||
i.xFine++;
|
i.xFine++;
|
||||||
|
if (i.xCoarse>=chanCount) {
|
||||||
|
logE("xCoarse of selStart iterator went too far!");
|
||||||
|
showError("you have found a bug. please report it now.");
|
||||||
|
i.xCoarse=chanCount-1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (i.xFine>=3+e->curPat[i.xCoarse].effectCols*2) {
|
if (i.xFine>=3+e->curPat[i.xCoarse].effectCols*2) {
|
||||||
i.xFine=0;
|
i.xFine=0;
|
||||||
i.xCoarse++;
|
i.xCoarse++;
|
||||||
|
|
@ -283,6 +290,12 @@ void FurnaceGUI::doSelectAll() {
|
||||||
}
|
}
|
||||||
for (SelectionPoint i; i.xCoarse!=selEnd.xCoarse || i.xFine!=selEnd.xFine; selEndX++) {
|
for (SelectionPoint i; i.xCoarse!=selEnd.xCoarse || i.xFine!=selEnd.xFine; selEndX++) {
|
||||||
i.xFine++;
|
i.xFine++;
|
||||||
|
if (i.xCoarse>=chanCount) {
|
||||||
|
logE("xCoarse of selEnd iterator went too far!");
|
||||||
|
showError("you have found a bug. please report it now.");
|
||||||
|
i.xCoarse=chanCount-1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (i.xFine>=3+e->curPat[i.xCoarse].effectCols*2) {
|
if (i.xFine>=3+e->curPat[i.xCoarse].effectCols*2) {
|
||||||
i.xFine=0;
|
i.xFine=0;
|
||||||
i.xCoarse++;
|
i.xCoarse++;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue