From 05882adb4470f3f0c05e1b6df593804cd65f9fa9 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 8 Apr 2009 16:33:28 +0200 Subject: Resolve the key string/name in the name tree before inserting the object into a dictionary. --- mupdf/pdf_nametree.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mupdf/pdf_nametree.c b/mupdf/pdf_nametree.c index 85a85b09..57292fd4 100644 --- a/mupdf/pdf_nametree.c +++ b/mupdf/pdf_nametree.c @@ -31,13 +31,25 @@ loadnametreenode(fz_obj *tree, pdf_xref *xref, fz_obj *node) { key = fz_arrayget(names, i * 2 + 0); val = fz_arrayget(names, i * 2 + 1); + + error = pdf_resolve(&key, xref); + if (error) + { + fz_dropobj(names); + fz_dropobj(node); + return fz_rethrow(error, "cannot resolve name tree key"); + } + error = fz_dictput(tree, key, val); if (error) { + fz_dropobj(key); fz_dropobj(names); fz_dropobj(node); return fz_rethrow(error, "cannot insert name tree entry"); } + + fz_dropobj(key); } fz_dropobj(names); -- cgit v1.2.3