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

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_parser.cpp

Issue 1871373002: fix infinite loops when rebuild the cross reference table (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_parser.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
index 4ba43678b80c3ca2198ad22257fa07b39ea9a040..a3e579ad6938e3c2597ae5ce060ebf3a7d10da33 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
@@ -931,9 +931,9 @@ FX_BOOL CPDF_Parser::RebuildCrossRef() {
}
pos += size;
- // If the position has not changed at all in a loop iteration, then break
- // out to prevent infinite looping.
- if (pos == saved_pos)
+ // If the position has not changed at all or went backwards in a loop
+ // iteration, then break out to prevent infinite looping.
+ if (pos <= saved_pos)
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698