summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdftext_embeddertest.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-03-19 17:44:55 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-19 17:44:55 +0000
commit20c94774cc7efb3d90d3181539714f43fdcf01d2 (patch)
tree4b70ce3495177e9101bc86630685a5af5f531a37 /fpdfsdk/fpdftext_embeddertest.cpp
parent30e0498962e8e4d99225a4da854ffd342677922c (diff)
downloadpdfium-20c94774cc7efb3d90d3181539714f43fdcf01d2.tar.xz
Avoid crashing in FPDFText_CountRects() for negative count values.
Treat values less than -1 as -1. BUG=chromium:821305 Change-Id: Ieaced045473fa51097400e5af1286f0d3f4d0143 Reviewed-on: https://pdfium-review.googlesource.com/28732 Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdftext_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdftext_embeddertest.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/fpdfsdk/fpdftext_embeddertest.cpp b/fpdfsdk/fpdftext_embeddertest.cpp
index c056908148..0cf10f5106 100644
--- a/fpdfsdk/fpdftext_embeddertest.cpp
+++ b/fpdfsdk/fpdftext_embeddertest.cpp
@@ -725,14 +725,11 @@ TEST_F(FPDFTextEmbeddertest, CountRects) {
EXPECT_EQ(2, FPDFText_CountRects(textpage, start, 500));
}
-#if 0
- // TODO(thestig): This crashes. Fix and enable.
// Now test negative counts.
for (int start = 0; start < kHelloWorldEnd; ++start) {
EXPECT_EQ(2, FPDFText_CountRects(textpage, start, -100));
EXPECT_EQ(2, FPDFText_CountRects(textpage, start, -2));
}
-#endif
// Now test larger start values.
const int kExpectedLength = strlen(kExpected);