diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-12-15 20:14:39 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2020-12-15 20:14:39 +0000 |
commit | babbe1b15d1c9f635298516f00f13b8ca79d4d5f (patch) | |
tree | cb8aae4c7c59f4aa9e67ac45e8e427bbd46b0d38 /Build/source/texk/dvipdfm-x/spc_pdfm.c | |
parent | 0a65a3ec9431c2736f74c6ddde40ae128752af4f (diff) |
dvipdfm-x : Fix a bug introduced in rev.56265: Change behavior when the resource
object is an indirect object.
git-svn-id: svn://tug.org/texlive/trunk@57144 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/spc_pdfm.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/spc_pdfm.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index 481943cce5f..d45e09330f2 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -193,6 +193,20 @@ safeputresdict (pdf_obj *kp, pdf_obj *vp, void *dp) key = pdf_name_value(kp); dict = pdf_lookup_dict(dp, key); + /* Not sure what is the best way to handle this situation */ + if (PDF_OBJ_INDIRECTTYPE(dict)) { + if (PDF_OBJ_INDIRECTTYPE(vp)) { + /* If two indirect objects are pointing the same object, do nothing. */ + if (!pdf_compare_reference(dict, vp)) { + return 0; + } else { + /* otherwise merge the content of old one (see below) */ + dict = pdf_deref_obj(dict); + pdf_release_obj(dict); /* decrement link count */ + } + } + } + if (pdf_obj_typeof(vp) == PDF_INDIRECT) { /* Copy the content of old resource category dict (if exists) */ if (dict) { |