Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2171)

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp

Issue 1365253003: Merge to XFA: Fix the issue that pdfium swallows 'fi' or 'ff' in some pdf files (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp ('k') | core/src/fpdfapi/fpdf_page/pageint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 48e9b98d3acdbb9dcd7b1579067ac1ec09df79d2..c9bcff6db6db116d7328244083b67558a720df63 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -9,27 +9,7 @@
#include "../../../include/fxcodec/fx_codec.h"
#include "pageint.h"
#include <limits.h>
-const FX_CHAR* const _PDF_OpCharType =
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIVIIIIVIIVIIIIIVVIIIIIIIIIIIIII"
- "IIVVVVVVIVVVVVVIVVVVVIIVVIIIIIII"
- "IIVVVVVVVVVVVVVVIVVVIIVVIVVIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII"
- "IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII";
-FX_BOOL _PDF_HasInvalidOpChar(const FX_CHAR* op) {
- if (!op) {
- return FALSE;
- }
- uint8_t ch;
- while ((ch = *op++)) {
- if (_PDF_OpCharType[ch] == 'I') {
- return TRUE;
- }
- }
- return FALSE;
-}
+
class CPDF_StreamParserAutoClearer {
public:
CPDF_StreamParserAutoClearer(CPDF_StreamParser** scoped_variable,
@@ -61,13 +41,7 @@ FX_DWORD CPDF_StreamContentParser::Parse(const uint8_t* pData,
case CPDF_StreamParser::EndOfData:
return m_pSyntax->GetPos();
case CPDF_StreamParser::Keyword:
- if (!OnOperator((char*)syntax.GetWordBuf()) &&
- _PDF_HasInvalidOpChar((char*)syntax.GetWordBuf())) {
- m_bAbort = TRUE;
- }
- if (m_bAbort) {
- return m_pSyntax->GetPos();
- }
+ OnOperator((char*)syntax.GetWordBuf());
ClearAllParams();
break;
case CPDF_StreamParser::Number:
@@ -1126,10 +1100,6 @@ void CPDF_ContentParser::Continue(IFX_Pause* pPause) {
m_CurrentOffset +=
m_pParser->Parse(m_pData + m_CurrentOffset,
m_Size - m_CurrentOffset, PARSE_STEP_LIMIT);
- if (m_pParser->ShouldAbort()) {
- m_InternalStage = PAGEPARSE_STAGE_CHECKCLIP;
- continue;
- }
}
}
if (m_InternalStage == PAGEPARSE_STAGE_CHECKCLIP) {
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp ('k') | core/src/fpdfapi/fpdf_page/pageint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698