figments: display: assert that we dont exceed pixel array bounds

This commit is contained in:
Torrie Fischer 2023-12-11 07:47:11 +01:00
parent 74c2ddb405
commit e5d4eea02b

View File

@ -43,6 +43,7 @@ CRGB&
Display::pixelAt(int idx)
{
const int kx = idx % pixelCount();
assert(abs(kx) < pixelCount());
if (kx < 0) {
return m_pixels[pixelCount() + 1 + kx];
} else {