From 2383bf65e5f3ee9bc58877905dd29eed2e194d19 Mon Sep 17 00:00:00 2001 From: Dien-Nhung Nguyen-Phu Date: Sun, 23 Jun 2024 18:07:07 +0700 Subject: fix: incorrect fb access --- src/main.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index 6110e2a..d3a959b 100644 --- a/src/main.c +++ b/src/main.c @@ -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]); -- cgit v1.2.3