From cba69ab08367be9555fac10ead26996bdffb2d3e Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Tue, 25 Jan 2005 21:42:37 +0000 Subject: [project @ 2005-01-25 21:42:37 by jmb] Ensure bitmap has been created. svn path=/import/netsurf/; revision=1468 --- image/mng.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'image') diff --git a/image/mng.c b/image/mng.c index 63a0d6a22..af65c8a1d 100644 --- a/image/mng.c +++ b/image/mng.c @@ -186,6 +186,8 @@ mng_bool nsmng_processheader(mng_handle mng, mng_uint32 width, mng_uint32 height c = (struct content *)mng_get_userdata(mng); assert(c != NULL); + LOG(("processing header (%p) %d, %d", c, width, height)); + c->bitmap = bitmap_create(width, height); if (!c->bitmap) { msg_data.error = messages_get("NoMemory"); @@ -252,7 +254,13 @@ bool nsmng_convert(struct content *c, int width, int height) { assert(c != NULL); - LOG(("Converting")); + LOG(("Converting %p '%s'", c, c->url)); + + /* by this point, the png should have been parsed + * and the bitmap created, so ensure that's the case + */ + if (!c->bitmap) + return nsmng_broadcast_error(c); /* Set the title */ -- cgit v1.2.3