diff options
Diffstat (limited to 'source/pdf/pdf-page.c')
-rw-r--r-- | source/pdf/pdf-page.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c index 9d8a27ec..f5ab501b 100644 --- a/source/pdf/pdf-page.c +++ b/source/pdf/pdf-page.c @@ -174,7 +174,13 @@ pdf_lookup_page_loc_imp(fz_context *ctx, pdf_document *doc, pdf_obj *node, int * } } } - while (hit == NULL); + /* If i < len && hit != NULL the desired page was found in the + Kids array, done. If i < len && hit == NULL the found page tree + node contains a Kids array that contains the desired page, loop + back to top to extract it. When i == len the Kids array has been + exhausted without finding the desired page, give up. + */ + while (hit == NULL && i < len); } fz_always(ctx) { |