diff options
author | Sebastian Rasmussen <sebras@gmail.com> | 2016-08-24 03:36:47 +0800 |
---|---|---|
committer | Sebastian Rasmussen <sebras@gmail.com> | 2016-08-24 17:36:15 +0800 |
commit | c875791e9b4f76bfa479a0e3fdc3dc49708e9279 (patch) | |
tree | 749090aefd755d2da45db561f1c9350e9e7889cd /source | |
parent | a92f0db5987b408bef0d9b07277c8ff2329e9ce5 (diff) | |
download | mupdf-c875791e9b4f76bfa479a0e3fdc3dc49708e9279.tar.xz |
Always check that PDF dict keys are names in same way.
Diffstat (limited to 'source')
-rw-r--r-- | source/pdf/pdf-object.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index 0acf069b..8a7e5a9b 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -1207,7 +1207,7 @@ pdf_dict_get(fz_context *ctx, pdf_obj *obj, pdf_obj *key) if (!OBJ_IS_DICT(obj)) return NULL; - if (key < PDF_OBJ__LIMIT) + if (key < PDF_OBJ_NAME__LIMIT) i = pdf_dict_find(ctx, obj, key); else i = pdf_dict_finds(ctx, obj, pdf_to_name(ctx, key)); @@ -1253,7 +1253,7 @@ pdf_dict_put(fz_context *ctx, pdf_obj *obj, pdf_obj *key, pdf_obj *val) if (DICT(obj)->len > 100 && !(obj->flags & PDF_FLAGS_SORTED)) pdf_sort_dict(ctx, obj); - if (key < PDF_OBJ__LIMIT) + if (key < PDF_OBJ_NAME__LIMIT) i = pdf_dict_find(ctx, obj, key); else i = pdf_dict_finds(ctx, obj, pdf_to_name(ctx, key)); @@ -1520,9 +1520,9 @@ pdf_dict_del(fz_context *ctx, pdf_obj *obj, pdf_obj *key) if (!OBJ_IS_NAME(key)) fz_throw(ctx, FZ_ERROR_GENERIC, "key is not a name (%s)", pdf_objkindstr(key)); - if (key < PDF_OBJ__LIMIT) + if (key < PDF_OBJ_NAME__LIMIT) pdf_dict_dels(ctx, obj, PDF_NAMES[(intptr_t)key]); - else if (key->kind == PDF_NAME) + else pdf_dict_dels(ctx, obj, NAME(key)->n); } |