From b22e61871ccfce6c6bc66130e7c6eed0f89b3386 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 24 Jan 2023 15:30:57 +0000 Subject: [PATCH] gtk: Don't try to make zero-size bitmaps Fixes complete failure to render wikipedia and the register when built against rsvg. --- frontends/gtk/bitmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontends/gtk/bitmap.c b/frontends/gtk/bitmap.c index bfd29e1f4..a995a9e28 100644 --- a/frontends/gtk/bitmap.c +++ b/frontends/gtk/bitmap.c @@ -53,6 +53,10 @@ static void *bitmap_create(int width, int height, enum gui_bitmap_flags flags) { struct bitmap *gbitmap; + if (width == 0 || height == 0) { + return NULL; + } + gbitmap = calloc(1, sizeof(struct bitmap)); if (gbitmap != NULL) { if (flags & BITMAP_OPAQUE) {