From 30dcbee88652a71c37b004bbdf614ed97709ac51 Mon Sep 17 00:00:00 2001 From: Cristy Date: Wed, 11 Sep 2019 08:13:44 -0400 Subject: [PATCH] ... --- coders/pdf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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. -- 2.40.0