diff options
| author | François Cartegnie <281376+fcartegnie@users.noreply.github.com> | 2024-06-24 14:01:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-24 14:01:44 +0200 |
| commit | 69b530cbbb72ad9e4b9a7a6c4742f29540664d00 (patch) | |
| tree | 89c62a3076159ccfc9ae629de1317f3450888db0 /src | |
| parent | 0d44481e1e2a129baff5483c9cb905e317455d04 (diff) | |
| parent | 2383bf65e5f3ee9bc58877905dd29eed2e194d19 (diff) | |
Merge pull request #29 from kienvo/fix-fb
fix: Out of bounds on framebuffer 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]);
|