summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-resources.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-03-15 12:44:36 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-03-16 14:51:41 +0100
commit4b66d5773bf513e72a82b10b0f80a529aaa12313 (patch)
tree8bdd71bb0ba499c8b0dd9ace6fc87b0bfd1798aa /source/pdf/pdf-resources.c
parent1cd2046b3cce264a3d13481652868fd1c31537fc (diff)
downloadmupdf-4b66d5773bf513e72a82b10b0f80a529aaa12313.tar.xz
Simplify PDF font creation code.
Don't create a useless pdf_font_desc when writing font resources. Simplify reference counting by using fewer intermediate variables.
Diffstat (limited to 'source/pdf/pdf-resources.c')
-rw-r--r--source/pdf/pdf-resources.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/pdf/pdf-resources.c b/source/pdf/pdf-resources.c
index 720ee2b1..be97a0ba 100644
--- a/source/pdf/pdf-resources.c
+++ b/source/pdf/pdf-resources.c
@@ -100,7 +100,7 @@ pdf_insert_image_resource(fz_context *ctx, pdf_document *doc, unsigned char dige
fz_warn(ctx, "warning: image resource already present");
else
res = pdf_keep_obj(ctx, obj);
- return res;
+ return pdf_keep_obj(ctx, res);
}
/* We do need to come up with an effective way to see what is already in the
@@ -142,7 +142,7 @@ pdf_insert_font_resource(fz_context *ctx, pdf_document *doc, unsigned char diges
fz_warn(ctx, "warning: font resource already present");
else
res = pdf_keep_obj(ctx, obj);
- return res;
+ return pdf_keep_obj(ctx, res);
}
void