Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1589783004: Merge to XFA: Loose checking for trailer's size field (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | fpdfsdk/src/fpdfview_embeddertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index 03bc9aec58665ca7447938c25956de61995fe52f..cd22b31238509519d027764a5df57e8fdb6b7164 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);
« no previous file with comments | « no previous file | fpdfsdk/src/fpdfview_embeddertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698