Merge pull request #29 from kienvo/fix-fb

fix: Out of bounds on framebuffer access
This commit is contained in:
François Cartegnie
2024-06-24 14:01:44 +02:00
committed by GitHub

View File

@@ -188,6 +188,10 @@ void TMR0_IRQHandler(void)
if ((brightness + 1) % 2)
leds_releaseall();
} else {
if (i + fb->scroll/SCROLL_IRATIO >= fb->width) {
leds_releaseall();
return;
}
led_write2dcol(i/2,
fb->buf[i+ fb->scroll/SCROLL_IRATIO],
fb->buf[i+ fb->scroll/SCROLL_IRATIO + 1]);