Fix a NULL dereference introduced from https://pdfium.googlesource.com/pdfium/+/5d9ac...
authorBo Xu <bo_xu@foxitsoftware.com>
Wed, 14 Jan 2015 01:02:12 +0000 (17:02 -0800)
committerBo Xu <bo_xu@foxitsoftware.com>
Wed, 14 Jan 2015 01:02:12 +0000 (17:02 -0800)
The test file is test/barcode_test.pdf

R=tsepez@chromium.org

Review URL: https://codereview.chromium.org/851713004

fpdfsdk/src/fpdfdoc.cpp

index 26c3946..f2a190b 100644 (file)
@@ -137,6 +137,8 @@ DLLEXPORT FPDF_LINK STDCALL FPDFLink_GetLinkAtPoint(FPDF_PAGE page, double x, do
        if (!page)
                return NULL;
     CPDF_Page* pPage = ((CPDFXFA_Page*)page)->GetPDFPage();
+       if (!pPage)
+               return NULL;
        // Link list is stored with the document
        CPDF_Document* pDoc = pPage->m_pDocument;
        CPDF_LinkList* pLinkList = (CPDF_LinkList*)pDoc->GetPrivateData(&THISMODULE);