diff options
author | Jitendar Kumar <jitendar.k@samsung.com> | 2015-04-22 11:24:15 +0530 |
---|---|---|
committer | Jitendar Kumar <jitendar.k@samsung.com> | 2015-04-22 11:24:15 +0530 |
commit | 312b020fa137c0042f6a605eba2e0c74d0fb4316 (patch) | |
tree | 48b4003e295f6f6ee37951f40fcb9206f2f3c440 /src/gd_topal.c | |
parent | 4cf53078a2e1c2f1a258094c0425bf8dbdf1de9e (diff) | |
download | libgd-312b020fa137c0042f6a605eba2e0c74d0fb4316.tar.gz |
Update gd_topal.c
Update `*cimP`, before null checking `nim`.
return `FALSE` if `nim` is NULL, or else copy and destroy the image and return `TRUE`.
Diffstat (limited to 'src/gd_topal.c')
-rw-r--r-- | src/gd_topal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gd_topal.c b/src/gd_topal.c index 28e10d9..d795d27 100644 --- a/src/gd_topal.c +++ b/src/gd_topal.c @@ -1519,11 +1519,11 @@ static int gdImageTrueColorToPaletteBody (gdImagePtr oim, int dither, int colors gdImageDestroy(nim); } nim = gdImageNeuQuant(oim, colorsWanted, oim->paletteQuantizationSpeed ? oim->paletteQuantizationSpeed : 2); - if (!nim) { - return FALSE; - } if (cimP) { *cimP = nim; + } + if (!nim) { + return FALSE; } else { gdImageCopy(oim, nim, 0, 0, 0, 0, oim->sx, oim->sy); gdImageDestroy(nim); |