From 311fbfa8e8695b11ef8a9bd82fb0243ee96c2990 Mon Sep 17 00:00:00 2001 From: nick black Date: Sat, 24 Apr 2021 04:55:04 -0400 Subject: [PATCH] ncblit_pixel plane size checks: scale geom #1572 --- src/lib/visual.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/visual.c b/src/lib/visual.c index 4dec619c3..cd63b5c16 100644 --- a/src/lib/visual.c +++ b/src/lib/visual.c @@ -159,12 +159,12 @@ ncvisual_blitset_geom(const notcurses* nc, const ncvisual* n, return -1; } int rows = (*leny + nc->tcache.cellpixy - 1) / nc->tcache.cellpixy; - if(rows > ncplane_dim_y(vopts->n)){ + if(rows > ncplane_dim_y(vopts->n) * nc->tcache.cellpixy){ logerror(nc, "Sprixel too tall %d for plane %d\n", *leny, ncplane_dim_y(vopts->n) * nc->tcache.cellpixy); return -1; } int cols = (*lenx + nc->tcache.cellpixx - 1) / nc->tcache.cellpixx; - if(cols > ncplane_dim_x(vopts->n)){ + if(cols > ncplane_dim_x(vopts->n) * nc->tcache.cellpixx){ logerror(nc, "Sprixel too wide %d for plane %d\n", *lenx, ncplane_dim_x(vopts->n) * nc->tcache.cellpixx); return -1; }