From 481646eb1cdba4f0401cd8f90d8a326ea1e39ae2 Mon Sep 17 00:00:00 2001 From: Ken Sharp Date: Tue, 21 Jun 2022 09:29:08 +0100 Subject: GhostPDF - Fix Outline processing The loop finding a named destination from the Names tree wasn't exiting on success, leading to an incorrect (not found) error return instead. Simply breaking out of the loop on success solves the problem. --- pdf/pdf_mark.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pdf/pdf_mark.c') diff --git a/pdf/pdf_mark.c b/pdf/pdf_mark.c index 72f12ca45..98e3dc627 100644 --- a/pdf/pdf_mark.c +++ b/pdf/pdf_mark.c @@ -744,6 +744,9 @@ static int pdfi_get_name_from_node(pdf_context *ctx, pdf_dict *node, char *str, code = pdfi_get_name_from_node(ctx, Kid, str, Name); pdfi_countdown(Kid); Kid = NULL; + if (code == 0) + break; + if (code < 0) { if (code == gs_error_undefined) continue; -- cgit v1.2.1