summaryrefslogtreecommitdiff
path: root/pdf
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2023-01-10 12:13:55 +0000
committerChris Liddell <chris.liddell@artifex.com>2023-01-10 12:13:55 +0000
commit3508e584a9120dbf3e262091b13b2d14a2d22771 (patch)
tree54a2bf2382da52f793bb01e0e8fc62bfa38cda4d /pdf
parentdc4bf27b1f6f6db5508f385e30f934bd689c94f0 (diff)
downloadghostpdl-3508e584a9120dbf3e262091b13b2d14a2d22771.tar.gz
Bug 706315: Fix condition for explicit freeing of file enumerator
We should only explicitly free the file enumerator if the enumeration loop exits early.
Diffstat (limited to 'pdf')
-rw-r--r--pdf/pdf_fmap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/pdf/pdf_fmap.c b/pdf/pdf_fmap.c
index 0d3bc8e36..eded1165b 100644
--- a/pdf/pdf_fmap.c
+++ b/pdf/pdf_fmap.c
@@ -681,12 +681,14 @@ static int pdfi_generate_native_fontmap(pdf_context *ctx)
continue;
code = sgets(sf, magic, 4, &nread);
if (code < 0 || nread < 4) {
+ code = 0;
sfclose(sf);
continue;
}
code = sfseek(sf, 0, SEEK_SET);
if (code < 0) {
+ code = 0;
sfclose(sf);
continue;
}