summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/user/app/vterm/font.c6
-rw-r--r--src/user/app/vterm/vterm.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/user/app/vterm/font.c b/src/user/app/vterm/font.c
index 5a9dd24..368d534 100644
--- a/src/user/app/vterm/font.c
+++ b/src/user/app/vterm/font.c
@@ -47,6 +47,11 @@ void font_load(const char *path) {
void font_blit(uint32_t glyph, int x, int y) {
if (glyph >= font.glyph_amt) glyph = 0;
+ if (x < 0 || (x+1) * font.w >= fb.width ||
+ y < 0 || (y+1) * font.h >= fb.height)
+ {
+ return;
+ }
dirty_mark(x, y);
@@ -60,4 +65,5 @@ void font_blit(uint32_t glyph, int x, int y) {
*((uint32_t*)&fb.b[fb.pitch * (y * font.h + j) + 4 * (x * font.w + i)]) = byte * 0xB0B0B0;
}
}
+ return;
}
diff --git a/src/user/app/vterm/vterm.c b/src/user/app/vterm/vterm.c
index 43180b2..50a7b98 100644
--- a/src/user/app/vterm/vterm.c
+++ b/src/user/app/vterm/vterm.c
@@ -26,7 +26,7 @@ void in_char(char c) {
cursor.x = 0;
cursor.y++;
}
- while (cursor.y * font.h >= fb.height) scroll();
+ while ((cursor.y + 1) * font.h >= fb.height) scroll();
}
int main();