summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-22 13:42:22 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-27 14:08:02 +0100
commit028851638ce03d77de1385bee92ada98620e6d7a (patch)
tree04f430af8ecbefbbc64a2e13265dfdff2dd8a766
parente5720af140822099b4f309e98ca5d269af4f8aee (diff)
downloadmupdf-028851638ce03d77de1385bee92ada98620e6d7a.tar.xz
Fix bug in pdfshow (confusion between indirect/resolved streams).
-rw-r--r--source/tools/pdfshow.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c
index c0358034..2649dab1 100644
--- a/source/tools/pdfshow.c
+++ b/source/tools/pdfshow.c
@@ -144,14 +144,14 @@ static void showstream(int num)
static void showobject(int num)
{
- pdf_obj *obj;
+ pdf_obj *ref, *obj;
if (!doc)
fz_throw(ctx, FZ_ERROR_GENERIC, "no file specified");
- obj = pdf_load_object(ctx, doc, num);
-
- if (pdf_is_stream(ctx, obj))
+ ref = pdf_new_indirect(ctx, doc, num, 0);
+ obj = pdf_resolve_indirect(ctx, ref);
+ if (pdf_is_stream(ctx, ref))
{
if (showbinary)
{
@@ -174,7 +174,7 @@ static void showobject(int num)
fz_write_printf(ctx, out, "\nendobj\n\n");
}
- pdf_drop_obj(ctx, obj);
+ pdf_drop_obj(ctx, ref);
}
static void showgrep(char *filename)