summaryrefslogtreecommitdiff
path: root/core/fpdftext
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-09-29 09:46:38 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-29 09:46:38 -0700
commitf7a0d695b7e4f7b0dede23605ef449145aaa6d5a (patch)
treef0f135ab9dbaff62e6f287d4d4207dd8ef293597 /core/fpdftext
parent561867e2b95a3872c2aed3b74a7e918816d56851 (diff)
downloadpdfium-f7a0d695b7e4f7b0dede23605ef449145aaa6d5a.tar.xz
Check for negative page size in FindTextlineFlowOrientation()
BUG=pdfium:606 Review-Url: https://codereview.chromium.org/2378373002
Diffstat (limited to 'core/fpdftext')
-rw-r--r--core/fpdftext/cpdf_textpage.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp
index d88464bfc4..b6eb87eea1 100644
--- a/core/fpdftext/cpdf_textpage.cpp
+++ b/core/fpdftext/cpdf_textpage.cpp
@@ -507,6 +507,9 @@ CPDF_TextPage::TextOrientation CPDF_TextPage::FindTextlineFlowOrientation()
const int32_t nPageWidth = static_cast<int32_t>(m_pPage->GetPageWidth());
const int32_t nPageHeight = static_cast<int32_t>(m_pPage->GetPageHeight());
+ if (nPageWidth <= 0 || nPageHeight <= 0)
+ return TextOrientation::Unknown;
+
std::vector<bool> nHorizontalMask(nPageWidth);
std::vector<bool> nVerticalMask(nPageHeight);
FX_FLOAT fLineHeight = 0.0f;