summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJitendar Kumar <jitendarKumar@users.noreply.github.com>2015-10-30 16:48:54 +0530
committerMike Frysinger <vapier@gentoo.org>2015-12-23 11:54:33 -0500
commit78dad445b3fc8a331cf30318daa1b604c5eb006a (patch)
tree7705b99c43069ee465253735aba484de0bb44374 /src
parenta9346dd2a4e332c36f5e907d8f446b6cae39c7bb (diff)
downloadlibgd-78dad445b3fc8a331cf30318daa1b604c5eb006a.tar.gz
circletexttest: check image creation return value
In circletexttest.c, return value of gdImageCreateFromJpeg() and gdImageCreateTrueColor() must be checked before dereferencing.
Diffstat (limited to 'src')
-rw-r--r--src/circletexttest.c4
1 files changed, 4 insertions, 0 deletions
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 {