diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2015-07-25 15:46:58 +0200 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2015-07-27 14:53:21 +0200 |
commit | 9148cbdc6649ded26c21f82336ec8e693cea5155 (patch) | |
tree | 554987e8c1189d74d10f61bc908c9554a8f67cda /source/pdf | |
parent | acecda5931657d155cba9f3c56e209693f02a086 (diff) | |
download | mupdf-9148cbdc6649ded26c21f82336ec8e693cea5155.tar.xz |
Correctly compare PDF names with null, true and false.
Commit f533104 introduced optimized handling of pdf names, null, true
and false. That commit handles most object types correctly in
pdf_objcmp() but it does not correctly handle comparisons such as
pdf_objcmp("/Crypt", "true") or pdf_objcmp("null", "/Crypt").
Fixes one issue from bug 696012.
Diffstat (limited to 'source/pdf')
-rw-r--r-- | source/pdf/pdf-object.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index c17d982c..3d795cfe 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -412,7 +412,8 @@ pdf_objcmp(fz_context *ctx, pdf_obj *a, pdf_obj *b) { if (b < PDF_OBJ_NAME__LIMIT) return a != b; - + if (b < PDF_OBJ__LIMIT) + return 1; if (b->kind != PDF_NAME) return 1; return strcmp(NAME(b)->n, PDF_NAMES[(intptr_t)a]); @@ -420,6 +421,8 @@ pdf_objcmp(fz_context *ctx, pdf_obj *a, pdf_obj *b) if (b < PDF_OBJ_NAME__LIMIT) { + if (a < PDF_OBJ__LIMIT) + return 1; if (a->kind != PDF_NAME) return 1; return strcmp(NAME(a)->n, PDF_NAMES[(intptr_t)b]); |