diff options
author | Bo Xu <bo_xu@foxitsoftware.com> | 2014-12-09 10:13:59 -0800 |
---|---|---|
committer | Bo Xu <bo_xu@foxitsoftware.com> | 2014-12-09 10:13:59 -0800 |
commit | ca5d7699d2f3a2445592ffd8aee3e758a2a16ac7 (patch) | |
tree | 9b111731c661b630a742ae9a7002f6e696610798 /core/src | |
parent | 4429eaa2d0c5f07118a57418a469ee39461cd4c5 (diff) | |
download | pdfium-ca5d7699d2f3a2445592ffd8aee3e758a2a16ac7.tar.xz |
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.cpp | 3 |
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 fb6d72ece1..66231aa528 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -3829,6 +3829,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); |