summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/spc_pdfm.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipdfm-x/spc_pdfm.c')
-rw-r--r--Build/source/texk/dvipdfm-x/spc_pdfm.c14
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) {