diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-01-23 15:33:44 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-01-23 15:33:44 -0800 |
commit | 2255a1bb3719b8492c795c8828d861bae037f6b9 (patch) | |
tree | 64e7db2ae5219f121d027b7a314ad514f85826ea /core/src | |
parent | 1b1bb499613adc8b051ed602b04bea8758e582e6 (diff) | |
download | pdfium-2255a1bb3719b8492c795c8828d861bae037f6b9.tar.xz |
Merge to XFA: Fix null crash in CheckTrailer.
This includes:
fa370ac Fix test naming in previous commit.
e0bbe4a Fix null crash in CheckTrailer.
TBR=bo_xu@foxitsoftware.com
Review URL: https://codereview.chromium.org/870173002
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 7af595de38..b759cc8a70 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -4030,14 +4030,14 @@ 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); return FALSE; } + if (pTrailer->GetType() != PDFOBJ_DICTIONARY) { + return FALSE; + } CPDF_Dictionary *pTrailerDict = pTrailer->GetDict(); if (pTrailerDict) { CPDF_Object *pEncrypt = pTrailerDict->GetElement("Encrypt"); |