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