From 78dad445b3fc8a331cf30318daa1b604c5eb006a Mon Sep 17 00:00:00 2001 From: Jitendar Kumar Date: Fri, 30 Oct 2015 16:48:54 +0530 Subject: circletexttest: check image creation return value In circletexttest.c, return value of gdImageCreateFromJpeg() and gdImageCreateTrueColor() must be checked before dereferencing. --- src/circletexttest.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/circletexttest.c') diff --git a/src/circletexttest.c b/src/circletexttest.c index 55e0970..c1e67ab 100644 --- a/src/circletexttest.c +++ b/src/circletexttest.c @@ -33,6 +33,10 @@ int main(void) #else im = gdImageCreateTrueColor(300, 300); #endif /* HAVE_LIBJPEG */ + if(!im) { + fprintf(stderr, "gdImageCreateTrueColor failed \n"); + return 1; + } if(gdImageSX(im) < gdImageSY(im)) { radius = gdImageSX(im) / 2; } else { -- cgit v1.2.1