Fix a crash in libdraw; I think this came from qrstuv.
authorPete <pete@debu.gs>
Thu, 2 Nov 2023 17:47:39 +0000 (10:47 -0700)
committerPete <pete@debu.gs>
Thu, 2 Nov 2023 18:00:18 +0000 (11:00 -0700)
libdraw/font.c

index f51804d21f95c62e4ff1dbb71f5df926d7f99e97..849bb2890f3e74bbcb24e024cc3562792a45c496 100644 (file)
@@ -355,6 +355,8 @@ fontresize(Font *f, int wid, int ncache, int depth)
        d = f->display;
        if(depth <= 0)
                depth = 1;
+       if(wid == 0)
+               wid = 1;
 
        new = allocimage(d, Rect(0, 0, ncache*wid, f->height), CHAN1(CGrey, depth), 0, 0);
        if(new == nil){