diff options
author | Wei Li <weili@chromium.org> | 2016-01-14 15:15:14 -0800 |
---|---|---|
committer | Wei Li <weili@chromium.org> | 2016-01-14 15:15:14 -0800 |
commit | 07fb4cf2caa9590402a1c610b9c9d2fb9976f752 (patch) | |
tree | bc72a65216576fe4e278793155fef38a644f1c0a /core/src | |
parent | 215816b7450a577e186cc0e5f1634c4c6610b86b (diff) | |
download | pdfium-07fb4cf2caa9590402a1c610b9c9d2fb9976f752.tar.xz |
Merge to XFA: Loose checking for trailer's size field
Although trailer's size value is required by spec, other readers such as
Acrobat or libpoppler can handle without it. Loose up the check to be
more tolerant.
BUG=pdfium:213
R=thestig@chromium.org
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/1582193002 .
(cherry picked from commit 34291b900ad0472eef582215cfce0d942a40fd16)
Review URL: https://codereview.chromium.org/1589783004 .
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 03bc9aec58..cd22b31238 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -378,11 +378,11 @@ FX_BOOL CPDF_Parser::LoadAllCrossRefV4(FX_FILESIZE xrefpos) { } int32_t xrefsize = GetDirectInteger(m_pTrailer, "Size"); - if (xrefsize <= 0 || xrefsize > kMaxXRefSize) { - return FALSE; + if (xrefsize > 0 && xrefsize <= kMaxXRefSize) { + ShrinkObjectMap(xrefsize); + m_V5Type.SetSize(xrefsize); } - ShrinkObjectMap(xrefsize); - m_V5Type.SetSize(xrefsize); + CFX_FileSizeArray CrossRefList; CFX_FileSizeArray XRefStreamList; CrossRefList.Add(xrefpos); |