diff options
| author | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-23 18:07:07 +0700 |
|---|---|---|
| committer | Dien-Nhung Nguyen-Phu <kein@kienlab.com> | 2024-06-23 18:07:07 +0700 |
| commit | 2383bf65e5f3ee9bc58877905dd29eed2e194d19 (patch) | |
| tree | 89c62a3076159ccfc9ae629de1317f3450888db0 /src | |
| parent | af1ffccd011238992b17f3957107bdbc92541eda (diff) | |
fix: incorrect fb access
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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]);
|