Fix reading past bounds removing from color ramp
This commit is contained in:
parent
97caad858f
commit
57bcc19bb3
|
@ -549,11 +549,11 @@ int colorband_element_remove(struct ColorBand *coba, int index)
|
|||
if (index < 0 || index >= coba->tot)
|
||||
return 0;
|
||||
|
||||
coba->tot--;
|
||||
for (a = index; a < coba->tot; a++) {
|
||||
coba->data[a] = coba->data[a + 1];
|
||||
}
|
||||
if (coba->cur) coba->cur--;
|
||||
coba->tot--;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue