summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-01-14 14:46:04 -0800
committerWei Li <weili@chromium.org>2016-01-14 14:46:04 -0800
commit34291b900ad0472eef582215cfce0d942a40fd16 (patch)
tree1deaf6e1ec330a1c2e869dd3c3348b73e4b7808c /core
parent1a82d5c28be2ebdb7524a7249e43026546d0ebf0 (diff)
downloadpdfium-34291b900ad0472eef582215cfce0d942a40fd16.tar.xz
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 Review URL: https://codereview.chromium.org/1582193002 .
Diffstat (limited to 'core')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp8
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);