From 7124d96b1f974799e5b0ea140a7ebf67208a119f Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 31 Dec 2011 12:57:47 +0000 Subject: ensure favicon is correctly set svn path=/trunk/netsurf/; revision=13358 --- image/ico.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'image') diff --git a/image/ico.c b/image/ico.c index ed0804ba9..65a85c2d4 100644 --- a/image/ico.c +++ b/image/ico.c @@ -135,6 +135,7 @@ static bool nsico_convert(struct content *c) bmp = ico_find(ico->ico, 255, 255); if (bmp == NULL) { /* return error */ + LOG(("Failed to select icon")); return false; } @@ -155,12 +156,18 @@ static bool nsico_redraw(struct content *c, struct content_redraw_data *data, /* select most appropriate sized icon for size */ bmp = ico_find(ico->ico, data->width, data->height); + if (bmp == NULL) { + /* return error */ + LOG(("Failed to select icon")); + return false; + } /* ensure its decided */ if (bmp->decoded == false) { if (bmp_decode(bmp) != BMP_OK) { return false; } else { + LOG(("Decoding bitmap")); bitmap_modified(bmp->bitmap); } @@ -218,7 +225,14 @@ static void *nsico_get_internal(const struct content *c, void *context) nsico_content *ico = (nsico_content *) c; /* TODO: Pick best size for purpose. * Currently assumes it's for a URL bar. */ - struct bmp_image *bmp = ico_find(ico->ico, 16, 16); + struct bmp_image *bmp; + + bmp = ico_find(ico->ico, 16, 16); + if (bmp == NULL) { + /* return error */ + LOG(("Failed to select icon")); + return NULL; + } if (bmp->decoded == false) { if (bmp_decode(bmp) != BMP_OK) { -- cgit v1.2.3