summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete <pete@debu.gs>2023-11-02 10:47:39 -0700
committerPete <pete@debu.gs>2024-04-16 18:41:18 -0700
commitd009da489695985c33857ae93f53fd4c7ed3a4e8 (patch)
treeaa0e7d85628dff555bcc85d411b4e9775cd7f1fa
parenta70e38715ba2780f681610d16cfd77968b68204c (diff)
Fix a crash in libdraw; I think this came from qrstuv.
-rw-r--r--libdraw/font.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libdraw/font.c b/libdraw/font.c
index f51804d2..849bb289 100644
--- a/libdraw/font.c
+++ b/libdraw/font.c
@@ -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){