diff options
-rw-r--r-- | core/fxcrt/cfx_blockbuffer.cpp | 5 | ||||
-rw-r--r-- | xfa/fde/xml/cfde_xmlsyntaxparser.cpp | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/core/fxcrt/cfx_blockbuffer.cpp b/core/fxcrt/cfx_blockbuffer.cpp index 7609fb9a25..aeef5653e8 100644 --- a/core/fxcrt/cfx_blockbuffer.cpp +++ b/core/fxcrt/cfx_blockbuffer.cpp @@ -11,7 +11,7 @@ namespace { -const int kAllocStep = 1024 * 1024; +const size_t kAllocStep = 1024 * 1024; } // namespace @@ -77,8 +77,7 @@ CFX_WideString CFX_BlockBuffer::GetTextData(size_t start, size_t length) const { size_t maybeDataLength = m_BufferSize - 1 - m_StartPosition; if (start > maybeDataLength) return CFX_WideString(); - if (length > maybeDataLength) - length = maybeDataLength; + length = std::min(length, maybeDataLength); CFX_WideString wsTextData; wchar_t* pBuf = wsTextData.GetBuffer(length); diff --git a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp index 9adf11be0f..57501cceca 100644 --- a/xfa/fde/xml/cfde_xmlsyntaxparser.cpp +++ b/xfa/fde/xml/cfde_xmlsyntaxparser.cpp @@ -683,7 +683,7 @@ void CFDE_XMLSyntaxParser::ParseTextChar(wchar_t character) { } } } - if (m_iEntityStart > 0 && + if (m_iEntityStart >= 0 && m_BlockBuffer.GetDataLength() > static_cast<size_t>(m_iEntityStart)) { m_BlockBuffer.DeleteTextChars(m_BlockBuffer.GetDataLength() - m_iEntityStart); |