Fix out-of-bounds access

This commit is contained in:
shylie 2025-06-04 20:09:43 -04:00
parent eab338e380
commit 1c9fc51d01

View File

@ -16,6 +16,8 @@ oled::~oled()
pixel& oled::operator()(int x, int y)
{
static pixel dummy;
if (x < 0 || x >= width || y < 0 || y >= height) { return dummy; }
return pixels[x + y * width];
}