summaryrefslogtreecommitdiff
path: root/frontends/gtk
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2023-01-24 15:30:57 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2023-01-24 15:30:57 +0000
commitb22e61871ccfce6c6bc66130e7c6eed0f89b3386 (patch)
treebe5765dac965eacfcdbbe11ca7cc8bf8ea9d88a5 /frontends/gtk
parentf7a0135300ead08731fe10a63891a12cc2dbe067 (diff)
downloadnetsurf-master.tar.gz
netsurf-master.tar.bz2
gtk: Don't try to make zero-size bitmapsHEADmaster
Fixes complete failure to render wikipedia and the register when built against rsvg.
Diffstat (limited to 'frontends/gtk')
-rw-r--r--frontends/gtk/bitmap.c4
1 files changed, 4 insertions, 0 deletions
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) {