summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mupdf/pdf_cmap.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/mupdf/pdf_cmap.c b/mupdf/pdf_cmap.c
index 4219f695..1c470051 100644
--- a/mupdf/pdf_cmap.c
+++ b/mupdf/pdf_cmap.c
@@ -601,11 +601,14 @@ static int codefromstring(unsigned char *buf, int len)
static fz_error *lexcmap(pdf_token_e *tok, fz_stream *file, char *buf, int n, int *sl)
{
fz_error *error;
+
error = pdf_lex(tok, file, buf, n, sl);
- if (!error && *tok == PDF_TKEYWORD)
- *tok = tokenfromkeyword(buf);
if (error)
return fz_rethrow(error, "cannot parse cmap token");
+
+ if (*tok == PDF_TKEYWORD)
+ *tok = tokenfromkeyword(buf);
+
return fz_okay;
}