diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-11-09 12:36:01 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-11-14 13:23:57 +0100 |
commit | f0690e5d4c6c6b1ae66b8c0bb3425bb2fbba0b29 (patch) | |
tree | 2c0812acaf0f607553504f3abd5f12d840b7b66b /source/pdf/pdf-xref.c | |
parent | 7c6c6a58d58b7df384704e909d34e47454582c15 (diff) | |
download | mupdf-f0690e5d4c6c6b1ae66b8c0bb3425bb2fbba0b29.tar.xz |
Add optional 'object' argument to pdf_add_stream.
Diffstat (limited to 'source/pdf/pdf-xref.c')
-rw-r--r-- | source/pdf/pdf-xref.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/pdf/pdf-xref.c b/source/pdf/pdf-xref.c index 1af2d391..6280c2ff 100644 --- a/source/pdf/pdf-xref.c +++ b/source/pdf/pdf-xref.c @@ -2624,9 +2624,13 @@ pdf_add_object_drop(fz_context *ctx, pdf_document *doc, pdf_obj *obj) } pdf_obj * -pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf) +pdf_add_stream(fz_context *ctx, pdf_document *doc, fz_buffer *buf, pdf_obj *obj) { - pdf_obj *ind = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 4)); + pdf_obj *ind; + if (!obj) + ind = pdf_add_object_drop(ctx, doc, pdf_new_dict(ctx, doc, 4)); + else + ind = pdf_add_object(ctx, doc, obj); fz_try(ctx) pdf_update_stream(ctx, doc, ind, buf, 0); fz_catch(ctx) |