summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2024-10-16 18:21:12 -0700
committerVito Caputo <vcaputo@pengaru.com>2024-10-16 18:21:12 -0700
commit069d910388502aa5d374c78bd7dfb54af09d38ec (patch)
tree30ce745392ef9884d9b1d6fd0cd96be542631144
parentf38bb043fdb62c57dba3ee4666632e7a21128e5a (diff)
vcr: prevent row overflow in mem vcr_draw_text()
Another row clipping check off by one, it'd be nice to make this draw text into partial rows... but this as-is may just scribble.
-rw-r--r--src/vcr.c2
-rw-r--r--src/vmon.c1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/vcr.c b/src/vcr.c
index 711e17a..74e1c21 100644
--- a/src/vcr.c
+++ b/src/vcr.c
@@ -991,7 +991,7 @@ void vcr_draw_text(vcr_t *vcr, vcr_layer_t layer, int x, int row, const vcr_str_
#endif /* USE_XLIB */
case VCR_BACKEND_TYPE_MEM: {
- if (row >= 0 && row * VCR_ROW_HEIGHT < vcr->height) {
+ if (row >= 0 && (row + 1) * VCR_ROW_HEIGHT < vcr->height) {
int y = row * VCR_ROW_HEIGHT + 3;
uint8_t mask = (0x1 << layer);
diff --git a/src/vmon.c b/src/vmon.c
index e6c0f14..c9b3d6c 100644
--- a/src/vmon.c
+++ b/src/vmon.c
@@ -798,6 +798,7 @@ static int vmon_snapshot(vmon_t *vmon)
#endif
}
+
/* handle the next backend event, may block */
static void vmon_process_event(vmon_t *vmon)
{
© All Rights Reserved