From ca5d7699d2f3a2445592ffd8aee3e758a2a16ac7 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Tue, 9 Dec 2014 10:13:59 -0800 Subject: 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 --- core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core') 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 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); -- cgit v1.2.3