summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-stream.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-07 13:51:00 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-08 13:22:51 +0100
commit39a83e8f8aaa8f0bf0c63c5eb40aa94191ce520a (patch)
tree4bb3a2fcf6ca63111d9b4439c01cb6b04c1a71db /source/pdf/pdf-stream.c
parentb59ff4e3956d8e62b6b76a0e23697b15bc8c9467 (diff)
downloadmupdf-39a83e8f8aaa8f0bf0c63c5eb40aa94191ce520a.tar.xz
Fix 698991: The pdf_is_stream call is too generous.
It should only return true for indirect references that are actually streams, not just any array/dict that is contained in a stream object.
Diffstat (limited to 'source/pdf/pdf-stream.c')
-rw-r--r--source/pdf/pdf-stream.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/pdf/pdf-stream.c b/source/pdf/pdf-stream.c
index fb517872..e2696bd1 100644
--- a/source/pdf/pdf-stream.c
+++ b/source/pdf/pdf-stream.c
@@ -20,11 +20,12 @@ pdf_obj_num_is_stream(fz_context *ctx, pdf_document *doc, int num)
}
int
-pdf_is_stream(fz_context *ctx, pdf_obj *obj)
+pdf_is_stream(fz_context *ctx, pdf_obj *ref)
{
- pdf_document *doc = pdf_get_bound_document(ctx, obj);
- int num = pdf_obj_parent_num(ctx, obj);
- return pdf_obj_num_is_stream(ctx, doc, num);
+ pdf_document *doc = pdf_get_indirect_document(ctx, ref);
+ if (doc)
+ return pdf_obj_num_is_stream(ctx, doc, pdf_to_num(ctx, ref));
+ return 0;
}
/*