gtk/bitmap: Assert surface width/height non-zero

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-10-03 14:25:43 +01:00
parent 6848cc890a
commit 58fee8749f
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74
1 changed files with 4 additions and 0 deletions

View File

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