summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor@ghostscript.com>2011-01-29 09:06:32 +0000
committerTor Andersson <tor@ghostscript.com>2011-01-29 09:06:32 +0000
commit33f9fc4ec85ba3a12efd6aa0e7bfd97d5e6c02a9 (patch)
tree88b7943639341976e4d72c67f20fad74bd7b82f1
parent3802ebf92723382070258bcd43771b2f4186c03f (diff)
downloadmupdf-33f9fc4ec85ba3a12efd6aa0e7bfd97d5e6c02a9.tar.xz
Don't try to copy arrays/dictionaries that are indirect references with fz_copyarray and fz_copydict.
-rw-r--r--fitz/obj_array.c2
-rw-r--r--fitz/obj_dict.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/fitz/obj_array.c b/fitz/obj_array.c
index c07312cf..a85373d1 100644
--- a/fitz/obj_array.c
+++ b/fitz/obj_array.c
@@ -26,7 +26,7 @@ fz_copyarray(fz_obj *obj)
fz_obj *new;
int i;
- if (!fz_isarray(obj))
+ if (fz_isindirect(obj) || !fz_isarray(obj))
fz_warn("assert: not an array (%s)", fz_objkindstr(obj));
new = fz_newarray(fz_arraylen(obj));
diff --git a/fitz/obj_dict.c b/fitz/obj_dict.c
index f5d3f733..d1cc22cc 100644
--- a/fitz/obj_dict.c
+++ b/fitz/obj_dict.c
@@ -48,7 +48,7 @@ fz_copydict(fz_obj *obj)
fz_obj *new;
int i;
- if (!fz_isdict(obj))
+ if (fz_isindirect(obj) || !fz_isdict(obj))
fz_throw("assert: not a dict (%s)", fz_objkindstr(obj));
new = fz_newdict(fz_dictlen(obj));