summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2022-02-01 15:09:01 +0700
committerGitHub <noreply@github.com>2022-02-01 15:09:01 +0700
commit167ea1f4f0003f3e9f7ca1e586189e99cf33d47f (patch)
treea21a237b619b048e0c6d88388744cf9f029d47ae /examples
parent3d760c2c213f7a63dbe13792262406177cd9738a (diff)
downloadlibgd-167ea1f4f0003f3e9f7ca1e586189e99cf33d47f.tar.gz
Fix tests based on coverity reports (#819)
* Partial #818, unused arg * Partial #818, init var * partail #818, fix va_args usage * partail #818, handle f* calls and avoid possible call to malloc with negative values * partail #818, prevent double free * partail #818, resource leak if test fail * partail #818, null deref fix * partail #818, avoid double free on fp failure * Partial #818, fix error msg * Partial #818, leak on error * Partial #818, null deref * Partial #818, avoid possible negative index on failure * partial #818, does not free if we return if requested new size overflow * partial #818, avoid double free, free where the alloc happened
Diffstat (limited to 'examples')
-rw-r--r--examples/nnquant.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/nnquant.c b/examples/nnquant.c
index 82e3672..5ce104e 100644
--- a/examples/nnquant.c
+++ b/examples/nnquant.c
@@ -18,18 +18,17 @@ int main()
{
gdImagePtr im, im2;
FILE *fp;
- char path[2048];
fp=fopen("resampledbug.jpeg", "rb");
if (!fp) {
- fprintf(stderr, "Can't load /home/pierre/IM3801.jpg\n");
+ fprintf(stderr, "Can't load resampledbug.jpeg\n");
return 1;
}
im = gdImageCreateFromJpeg(fp);
fclose(fp);
if (!im) {
- fprintf(stderr, "Can't load TIFF image %s\n", path);
+ fprintf(stderr, "Can't decode JPEG image resampledbug.jpeg\n");
return 1;
}