Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf files
[pdfium.git] / core / src / fpdfapi / fpdf_page / fpdf_page_parser.cpp
index 47ba46a..4e5ef1c 100644 (file)
@@ -11,7 +11,6 @@
 
 #define REQUIRE_PARAMS(count)  \
   if (m_ParamCount != count) { \
-    m_bAbort = TRUE;           \
     return;                    \
   }
 
@@ -34,7 +33,6 @@ CPDF_StreamContentParser::CPDF_StreamContentParser(
       m_Level(level),
       m_ParamStartPos(0),
       m_ParamCount(0),
-      m_bAbort(FALSE),
       m_pCurStates(new CPDF_AllStates),
       m_pLastTextObject(nullptr),
       m_DefFontSize(0),
@@ -83,9 +81,7 @@ CPDF_StreamContentParser::~CPDF_StreamContentParser() {
   for (int i = 0; i < m_StateStack.GetSize(); ++i) {
     delete (CPDF_AllStates*)m_StateStack[i];
   }
-  if (m_pPathPoints) {
-    FX_Free(m_pPathPoints);
-  }
+  FX_Free(m_pPathPoints);
   if (m_pLastImageDict) {
     m_pLastImageDict->Release();
   }
@@ -1087,9 +1083,7 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Fill() {
   } else {
     m_pCurStates->m_ColorState.SetFillColor(NULL, values, nvalues);
   }
-  if (values) {
-    FX_Free(values);
-  }
+  FX_Free(values);
 }
 void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() {
   if (m_Options.m_bTextOnly) {
@@ -1119,9 +1113,7 @@ void CPDF_StreamContentParser::Handle_SetColorPS_Stroke() {
   } else {
     m_pCurStates->m_ColorState.SetStrokeColor(NULL, values, nvalues);
   }
-  if (values) {
-    FX_Free(values);
-  }
+  FX_Free(values);
 }
 CFX_FloatRect _GetShadingBBox(CPDF_Stream* pStream,
                               int type,