summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2020-10-03 14:25:43 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2020-10-03 14:25:43 +0100
commit58fee8749ffe41b0bb7c71456eddb808cbde8821 (patch)
treedf0d014869950c01d345ff06ec7f091feba57bb8
parent6848cc890a5eab8ea166b737d7f35a5b8ed94950 (diff)
downloadnetsurf-58fee8749ffe41b0bb7c71456eddb808cbde8821.tar.gz
netsurf-58fee8749ffe41b0bb7c71456eddb808cbde8821.tar.bz2
gtk/bitmap: Assert surface width/height non-zero
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
-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 36b614cf9..e7b859d06 100644
--- a/frontends/gtk/bitmap.c
+++ b/frontends/gtk/bitmap.c
@@ -478,6 +478,10 @@ bitmap_render(struct bitmap *bitmap, struct hlcache_handle *content)
* aspect ratio of the required thumbnail. */
cheight = ((cwidth * dheight) + (dwidth / 2)) / dwidth;
+ /* At this point, we MUST have decided to render something non-zero sized */
+ assert(cwidth > 0);
+ assert(cheight > 0);
+
/* Create surface to render into */
surface = cairo_surface_create_similar(dsurface, CAIRO_CONTENT_COLOR_ALPHA, cwidth, cheight);