cage1016 / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

CPDF_DataAvail::CheckPageNode error. #79

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I test "CPDF_DataAvail" using "pdf_reference_1-7.pdf"

The function will cause CPDF_DataAvail to load all file data.
"
FX_BOOL CPDF_DataAvail::CheckPageNode(CPDF_PageNode &pageNodes, FX_INT32 iPage, 
FX_INT32 &iCount, IFX_DownloadHints* pHints)
{
    FX_INT32 iSize = pageNodes.m_childNode.GetSize();
    if (iSize <= 0 || iPage >= iSize) {
        m_docStatus = PDF_DATAAVAIL_ERROR;
        return FALSE;
    }
    ....
}
"
The "iPage" is the index in the page tree, but iSize is just the size of 
m_childNode. So it will cause an error. And the CPDF_DataAvail will loadAllFile.

Such as

"
1 0 obj
<< /Type /Pages /Kids [2 0 R 3 0 R 4 0 R] >>
endobj

2 0 obj
<< /Parent 1 0 R /Type /Pages /Kids [5 0 R 6 0 R 7 0 R 8 0 R 9 0 R 10 0 R] >>
endobj

5 0 obj
<< /Parent 2 0 R /Type /Pages /Kids [11 0 R 12 0 R 13 0 R 14 0 R 15 0 R] >>
endobj
"

The "iPage" is 3, but the "iSize" is 3, too.

Original issue reported on code.google.com by duanh...@gmail.com on 18 Nov 2014 at 6:54

GoogleCodeExporter commented 9 years ago

Original comment by duanh...@gmail.com on 18 Nov 2014 at 7:16

Attachments: