diff options
author | Jitendar Kumar <jitendarKumar@users.noreply.github.com> | 2015-10-30 16:48:54 +0530 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-12-23 11:54:33 -0500 |
commit | 78dad445b3fc8a331cf30318daa1b604c5eb006a (patch) | |
tree | 7705b99c43069ee465253735aba484de0bb44374 /src/circletexttest.c | |
parent | a9346dd2a4e332c36f5e907d8f446b6cae39c7bb (diff) | |
download | libgd-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/circletexttest.c')
-rw-r--r-- | src/circletexttest.c | 4 |
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 { |