summaryrefslogtreecommitdiff
path: root/core/fpdfapi/fpdf_parser
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-06-07 10:43:42 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 10:43:42 -0700
commit0687e76dc259c678b3f29a6608331f07ffd8f1e2 (patch)
tree8cf32248ed1a228ec0b5b2fa34bdeebd4cfa7c4c /core/fpdfapi/fpdf_parser
parent705f829624bfc53e316f750bf91a32c8ae3ad1b5 (diff)
downloadpdfium-0687e76dc259c678b3f29a6608331f07ffd8f1e2.tar.xz
Check the hint table exists before using.
It's possible for the hint table to not exist event though we have a hint key in the object database. If the table does not exist then return false from CheckHIntTables(). BUG=pdfium:512 Review-Url: https://codereview.chromium.org/2047723002
Diffstat (limited to 'core/fpdfapi/fpdf_parser')
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
index f371e673ed..c705a657aa 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
@@ -748,6 +748,9 @@ FX_BOOL CPDF_DataAvail::CheckHintTables(IPDF_DataAvail::DownloadHints* pHints) {
}
CPDF_Array* pHintStreamRange = pDict->GetArrayBy("H");
+ if (!pHintStreamRange)
+ return FALSE;
+
FX_FILESIZE szHSStart =
pHintStreamRange->GetDirectObjectAt(0)
? pHintStreamRange->GetDirectObjectAt(0)->GetInteger()