summaryrefslogtreecommitdiff
path: root/src/gd_jpeg.c
diff options
context:
space:
mode:
authortabe <none@none>2009-06-18 13:35:26 +0000
committertabe <none@none>2009-06-18 13:35:26 +0000
commite27c3c7f2c6f16c18031a00f940102c03bb64ae0 (patch)
treef87ef62609381074a06589db5cd4132cf795db79 /src/gd_jpeg.c
parent1f025d2d729b6d821f219046899a9e1f35d3e04f (diff)
downloadlibgd-e27c3c7f2c6f16c18031a00f940102c03bb64ae0.tar.gz
fix for FS#204
* gdImageCreateFrom*() returns null if null pointer given * gdImage*() puts nothing if null pointer given
Diffstat (limited to 'src/gd_jpeg.c')
-rw-r--r--src/gd_jpeg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gd_jpeg.c b/src/gd_jpeg.c
index 2f48c9a..668fdee 100644
--- a/src/gd_jpeg.c
+++ b/src/gd_jpeg.c
@@ -95,6 +95,7 @@ static void fatal_jpeg_error(j_common_ptr cinfo)
BGD_DECLARE(void) gdImageJpeg(gdImagePtr im, FILE *outFile, int quality)
{
gdIOCtx *out = gdNewFileCtx(outFile);
+ if (out == NULL) return;
gdImageJpegCtx(im, out, quality);
out->gd_free(out);
}
@@ -265,6 +266,7 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromJpeg(FILE *inFile)
{
gdImagePtr im;
gdIOCtx *in = gdNewFileCtx(inFile);
+ if (in == NULL) return NULL;
im = gdImageCreateFromJpegCtx(in);
in->gd_free(in);
return im;