Index: xfa/src/fgas/src/xml/fx_sax_imp.cpp |
diff --git a/xfa/src/fgas/src/xml/fx_sax_imp.cpp b/xfa/src/fgas/src/xml/fx_sax_imp.cpp |
index dce96470a69eec15c24d3f18128352a1da22603d..6b3cc778ab0af7842888a1b850b0a95c117bd670 100644 |
--- a/xfa/src/fgas/src/xml/fx_sax_imp.cpp |
+++ b/xfa/src/fgas/src/xml/fx_sax_imp.cpp |
@@ -4,8 +4,17 @@ |
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
+#include <algorithm> |
+ |
#include "xfa/src/fgas/src/fgas_base.h" |
#include "fx_sax_imp.h" |
+ |
+namespace { |
+ |
+const FX_DWORD kSaxFileBufSize = 32768; |
+ |
+} // namespace |
+ |
IFX_SAXReader* FX_SAXReader_Create() { |
return new CFX_SAXReader; |
} |
@@ -31,7 +40,7 @@ FX_BOOL CFX_SAXFile::StartFile(IFX_FileRead* pFile, |
if (dwLen == 0) { |
return FALSE; |
} |
- m_dwBufSize = FX_MIN(dwLen, FX_SAXFILE_BUFSIZE); |
+ m_dwBufSize = std::min(dwLen, kSaxFileBufSize); |
m_pBuf = FX_Alloc(uint8_t, m_dwBufSize); |
if (!pFile->ReadBlock(m_pBuf, dwStart, m_dwBufSize)) { |
return FALSE; |
@@ -49,7 +58,7 @@ FX_BOOL CFX_SAXFile::ReadNextBlock() { |
if (dwSize == 0) { |
return FALSE; |
} |
- m_dwBufSize = FX_MIN(dwSize, FX_SAXFILE_BUFSIZE); |
+ m_dwBufSize = std::min(dwSize, kSaxFileBufSize); |
if (!m_pFile->ReadBlock(m_pBuf, m_dwCur, m_dwBufSize)) { |
return FALSE; |
} |