gtk: Don't try to make zero-size bitmaps

Fixes complete failure to render wikipedia and the register when
built against rsvg.
This commit is contained in:
Michael Drake 2023-01-24 15:30:57 +00:00
parent f7a0135300
commit b22e61871c

View File

@ -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) {