From: Cristy Date: Wed, 11 Sep 2019 12:13:44 +0000 (-0400) Subject: ... X-Git-Tag: 7.0.8-65~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=30dcbee88652a71c37b004bbdf614ed97709ac51;p=imagemagick ... --- diff --git a/coders/pdf.c b/coders/pdf.c index 113124e45..7bb168ebf 100644 --- a/coders/pdf.c +++ b/coders/pdf.c @@ -541,7 +541,14 @@ static Image *ReadPDFImage(const ImageInfo *image_info,ExceptionInfo *exception) image=DestroyImage(image); return((Image *) NULL); } - (void) write(file," ",1); + if (write(file," ",1) != 1) + { + file=close(file)-1; + (void) RelinquishUniqueFileResource(postscript_filename); + CleanupPDFInfo(&pdf_info); + image=DestroyImage(image); + return((Image *) NULL); + } file=close(file)-1; /* Render Postscript with the Ghostscript delegate.