summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spuregion.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/spuregion.c b/spuregion.c
index b2a6526..afa40da 100644
--- a/spuregion.c
+++ b/spuregion.c
@@ -51,7 +51,7 @@ bool cSpuRegion::newSection()
sSection *cSpuRegion::section(uint8_t num)
{
- if (usedSections == MAX_SECTIONS) {
+ if (num >= MAX_SECTIONS) {
return NULL;
}
@@ -60,12 +60,11 @@ sSection *cSpuRegion::section(uint8_t num)
bool cSpuRegion::addIndex(tIndex idx)
{
- sSection *sec = &sections[usedSections];
-
if (containsIndex(idx)) {
return true;
}
+ sSection *sec = &sections[usedSections];
if (sec->usedColors == MAX_COLORS) {
return false;
}