From 41536004107b221763ec63cf86863763f58d2fad Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Sat, 2 Feb 2019 12:28:02 +1100 Subject: [PATCH] add assertions for callers to i_new_hatch_low() in fills.c coverity complained that effectively both fg and ffg could be NULL which isn't the case. Try to let it know better. I'm going to rearrange i_new_hatch_low() in the next commit. CID 185339. --- fills.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fills.c b/fills.c index 479f9d49..4754e265 100644 --- a/fills.c +++ b/fills.c @@ -1,6 +1,7 @@ #define IMAGER_NO_CONTEXT #include "imager.h" #include "imageri.h" +#include /* =head1 NAME @@ -436,6 +437,8 @@ with the side of a filled area. i_fill_t * i_new_fill_hatch(const i_color *fg, const i_color *bg, int combine, int hatch, const unsigned char *cust_hatch, i_img_dim dx, i_img_dim dy) { + assert(fg); + assert(bg); return i_new_hatch_low(fg, bg, NULL, NULL, combine, hatch, cust_hatch, dx, dy); } @@ -464,6 +467,8 @@ with the side of a filled area. i_fill_t * i_new_fill_hatchf(const i_fcolor *fg, const i_fcolor *bg, int combine, int hatch, const unsigned char *cust_hatch, i_img_dim dx, i_img_dim dy) { + assert(fg); + assert(bg); return i_new_hatch_low(NULL, NULL, fg, bg, combine, hatch, cust_hatch, dx, dy); } -- 2.39.5