[ncplane_resize_internal] correct tozorch calculation

This commit is contained in:
nick black 2021-12-10 01:03:17 -05:00
parent 1f713c4e47
commit 1322fabbb7
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -857,7 +857,7 @@ int ncplane_resize_internal(ncplane* n, int keepy, int keepx,
}else if(realloced){
// the x dimensions are equal, and we're keeping across the width. only the
// y dimension changed. at worst, we need zero some out.
unsigned tozorch = (ylen - keepleny) * xlen;
unsigned tozorch = (ylen - keepleny) * xlen * sizeof(*fb);
if(tozorch){
unsigned zorchoff = keepleny * xlen;
memset(fb + zorchoff, 0, tozorch);