diff options
author | tabe <none@none> | 2009-06-18 13:35:26 +0000 |
---|---|---|
committer | tabe <none@none> | 2009-06-18 13:35:26 +0000 |
commit | e27c3c7f2c6f16c18031a00f940102c03bb64ae0 (patch) | |
tree | f87ef62609381074a06589db5cd4132cf795db79 /src/gd_jpeg.c | |
parent | 1f025d2d729b6d821f219046899a9e1f35d3e04f (diff) | |
download | libgd-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.c | 2 |
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; |