diff options
author | Jun Fang <jun_fang@foxitsoftware.com> | 2014-08-22 17:04:29 -0700 |
---|---|---|
committer | Jun Fang <jun_fang@foxitsoftware.com> | 2014-08-22 17:04:29 -0700 |
commit | aeacba4a612a0a35b3e834d778716968c661f3ec (patch) | |
tree | ed71f0098e1388a9a74c176fadb9fb53fd1f1984 /core | |
parent | 02132dcdf97674c223d9a3566c89df9f57029d5c (diff) | |
download | pdfium-aeacba4a612a0a35b3e834d778716968c661f3ec.tar.xz |
Fix a hang issue due to inconsistent page number in the test file
Pdfium reads the page number from the field of '/Count' but it can't
load the number assigned by this field due to the damaged data. Add a
check to ensure that the required page should be one of loaded pages.
BUG=406090
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/477873003
Diffstat (limited to 'core')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index e0fd3bfaee..ce397d2a53 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -3989,7 +3989,7 @@ FX_BOOL CPDF_DataAvail::CheckUnkownPageNode(FX_DWORD dwPageNo, CPDF_PageNode *pP 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) { + if (iSize <= 0 || iPage >= iSize) { m_docStatus = PDF_DATAAVAIL_ERROR; return FALSE; } |