diff --git a/src/picoled.cpp b/src/picoled.cpp index dc95ec0..beabab1 100644 --- a/src/picoled.cpp +++ b/src/picoled.cpp @@ -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]; }