diff options
author | Ryan Harrison <rharrison@chromium.org> | 2017-09-01 13:30:19 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-09-01 17:48:53 +0000 |
commit | 7558414b8aa1d14ce02e360dd88e4f421cee8725 (patch) | |
tree | 2514a4cbf682f4222d22fc7974ca4ab6937bf2d3 /core/fxcrt/cfx_seekablestreamproxy.cpp | |
parent | dce09b18b48837d8006694b9dc3b2d026e5e7869 (diff) | |
download | pdfium-7558414b8aa1d14ce02e360dd88e4f421cee8725.tar.xz |
Prepare for converting FX_STRSIZE int->size_t
When turning on this conversion a number of typing issues and other nits where
found in the code base that can be merged in without actually changing the
underlying type. Landing these changes before the type change CL, since there is
a high likelihood that the type change will need to be rolled back, since it is
high risk.
BUG=pdfium:828
Change-Id: I587443d9090055963446485a1aacb8772eb5ca64
Reviewed-on: https://pdfium-review.googlesource.com/12810
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fxcrt/cfx_seekablestreamproxy.cpp')
-rw-r--r-- | core/fxcrt/cfx_seekablestreamproxy.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fxcrt/cfx_seekablestreamproxy.cpp b/core/fxcrt/cfx_seekablestreamproxy.cpp index da1170717a..a67ec52c85 100644 --- a/core/fxcrt/cfx_seekablestreamproxy.cpp +++ b/core/fxcrt/cfx_seekablestreamproxy.cpp @@ -230,15 +230,15 @@ FX_STRSIZE CFX_SeekableStreamProxy::ReadData(uint8_t* pBuffer, FX_STRSIZE CFX_SeekableStreamProxy::ReadString(wchar_t* pStr, FX_STRSIZE iMaxLength, bool* bEOS) { - ASSERT(pStr); - ASSERT(iMaxLength > 0); + if (!pStr || iMaxLength <= 0) + return 0; if (m_IsWriteStream) return 0; if (m_wCodePage == FX_CODEPAGE_UTF16LE || m_wCodePage == FX_CODEPAGE_UTF16BE) { - FX_FILESIZE iBytes = iMaxLength * 2; + FX_STRSIZE iBytes = iMaxLength * 2; FX_STRSIZE iLen = ReadData(reinterpret_cast<uint8_t*>(pStr), iBytes); iMaxLength = iLen / 2; if (sizeof(wchar_t) > 2 && iMaxLength > 0) |