robustness improvements
* handling of stop = 0 when calculating sizes (avoid unsigned underflow) * make sure groupLength() is never zero (to avoid div/0) * gapmaps: check for "(gapSize > 0)" added. not sure if all the checks are 100% needed, but they will improve robustness in corner cases.
This commit is contained in:
@@ -1050,7 +1050,7 @@ uint32_t Segment::getPixelColor(int i)
|
||||
i += start;
|
||||
/* offset/phase */
|
||||
i += offset;
|
||||
if (i >= stop) i -= length();
|
||||
if ((i >= stop) && (stop>0)) i -= length(); // WLEDMM avoid negative index (stop = 0 is a possible value)
|
||||
return strip.getPixelColor(i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user