summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-12-09 10:13:59 -0800
committerBo Xu <bo_xu@foxitsoftware.com>2014-12-09 10:22:46 -0800
commitea02bddce0b29dd8842170856a1519f21d5e8181 (patch)
tree7388f873290d7c9ed0e18bd8e67629ff8aba46ed /core/src
parentfb9472868e3592d643d064135c7c91e4659962a8 (diff)
downloadpdfium-ea02bddce0b29dd8842170856a1519f21d5e8181.tar.xz
Merge to XFA: patch from CL 787753002
Trailer should be a dictionary object BUG=https://code.google.com/p/pdfium/issues/detail?id=86 a "<<" token should follow "trailer" but "<" will trick the parser to make trailer a hex string object. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/787753002
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
index b1dfc73af7..e0cb8277d7 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp
@@ -3833,6 +3833,9 @@ FX_BOOL CPDF_DataAvail::CheckTrailer(IFX_DownloadHints* pHints)
CFX_SmartPointer<IFX_FileStream> file(FX_CreateMemoryStream(pBuf, (size_t)iSize, FALSE));
m_syntaxParser.InitParser((IFX_FileStream*)file, 0);
CPDF_Object *pTrailer = m_syntaxParser.GetObject(NULL, 0, 0, 0);
+ if (pTrailer->GetType() != PDFOBJ_DICTIONARY) {
+ return FALSE;
+ }
if (!pTrailer) {
m_Pos += m_syntaxParser.SavePos();
pHints->AddSegment(m_Pos, iTrailerSize);