From 028851638ce03d77de1385bee92ada98620e6d7a Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Thu, 22 Feb 2018 13:42:22 +0100 Subject: Fix bug in pdfshow (confusion between indirect/resolved streams). --- source/tools/pdfshow.c | 10 +++++----- 1 file 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) -- cgit v1.2.3