ncblit_pixel plane size checks: scale geom #1572

pull/1589/head
nick black 3 years ago
parent 95072d0f5c
commit 311fbfa8e8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -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;
}

Loading…
Cancel
Save