diff options
author | jinming_wang <jinming_wang@foxitsoftware.com> | 2016-04-11 10:43:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-11 10:43:19 -0700 |
commit | f3209c1fe0fdea79bf2f4e2b6f77ea4ef5db1ad2 (patch) | |
tree | 34dd5c7ddf4cfc8977847af29bacb17329ec8418 /core/fpdfapi/fpdf_parser | |
parent | e1aebd43b0c75133f94f8b141b33d12e2e715524 (diff) | |
download | pdfium-f3209c1fe0fdea79bf2f4e2b6f77ea4ef5db1ad2.tar.xz |
fix infinite loops when rebuild the cross reference table
BUG=chromium:401189
Review URL: https://codereview.chromium.org/1871373002
Diffstat (limited to 'core/fpdfapi/fpdf_parser')
-rw-r--r-- | core/fpdfapi/fpdf_parser/cpdf_parser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp index 97b03f046c..f1816f2028 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; } |