From 624b166d4f50874f93c6d0824e91cd5b955c0487 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Thu, 15 Jan 2015 18:14:43 -0800 Subject: Allow FPDFBookmark_GetFirstChild to return the top level bookmark Previously when passing a NULL bookmark to FPDFBookmark_GetFirstChild it returned NULL instead of returning the top level bookmark. This change removes the early exit in this case allowing the top level bookmark to be retrieved. BUG=https://code.google.com/p/pdfium/issues/detail?id=110 R=bo_xu@foxitsoftware.com, tsepez@chromium.org Review URL: https://codereview.chromium.org/847243005 --- fpdfsdk/src/fpdfdoc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fpdfsdk/src/fpdfdoc.cpp b/fpdfsdk/src/fpdfdoc.cpp index feb7cfbde5..41f5c8a1bb 100644 --- a/fpdfsdk/src/fpdfdoc.cpp +++ b/fpdfsdk/src/fpdfdoc.cpp @@ -29,7 +29,7 @@ static CPDF_Bookmark FindBookmark(const CPDF_BookmarkTree& tree, CPDF_Bookmark b DLLEXPORT FPDF_BOOKMARK STDCALL FPDFBookmark_GetFirstChild(FPDF_DOCUMENT document, FPDF_BOOKMARK pDict) { - if (!document || !pDict) + if (!document) return NULL; CPDF_Document* pDoc = (CPDF_Document*)document; CPDF_BookmarkTree tree(pDoc); -- cgit v1.2.3