Plug a leak in CPDF_StreamParser::ReadInlineStream
authorOliver Chang <ochang@chromium.org>
Thu, 15 Oct 2015 23:55:21 +0000 (16:55 -0700)
committerOliver Chang <ochang@chromium.org>
Thu, 15 Oct 2015 23:55:21 +0000 (16:55 -0700)
R=thestig@chromium.org, tsepez@chromium.org
BUG=pdfium:212

Review URL: https://codereview.chromium.org/1405203002 .

core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp

index ace7bf9..b1e89e8 100644 (file)
@@ -397,6 +397,7 @@ CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
         PDF_DecodeInlineStream(m_pBuf + m_Pos, m_Size - m_Pos, width, height,
                                Decoder, pParam, pData, dwDestSize);
     if ((int)dwStreamSize < 0) {
+      FX_Free(pData);
       return NULL;
     }
     if (bDecode) {