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

Unified Diff: Source/wtf/text/TextCodecICU.cpp

Issue 23532016: Handle odd data lengths in UTF-16 decoder (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simplify Created 6 years, 10 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 | « Source/wtf/text/TextCodecICU.h ('k') | Source/wtf/text/TextCodecLatin1.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/TextCodecICU.cpp
diff --git a/Source/wtf/text/TextCodecICU.cpp b/Source/wtf/text/TextCodecICU.cpp
index f6f54e07fd66002daa444ce83398af1af6117131..72cddfdd54a64257c5383ad76e2d1c6598cb547d 100644
--- a/Source/wtf/text/TextCodecICU.cpp
+++ b/Source/wtf/text/TextCodecICU.cpp
@@ -337,7 +337,7 @@ private:
UConverterToUCallback m_savedAction;
};
-String TextCodecICU::decode(const char* bytes, size_t length, bool flush, bool stopOnError, bool& sawError)
+String TextCodecICU::decode(const char* bytes, size_t length, FlushBehavior flush, bool stopOnError, bool& sawError)
{
// Get a converter for the passed-in encoding.
if (!m_converterICU) {
@@ -361,7 +361,7 @@ String TextCodecICU::decode(const char* bytes, size_t length, bool flush, bool s
UErrorCode err = U_ZERO_ERROR;
do {
- int ucharsDecoded = decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, flush, err);
+ int ucharsDecoded = decodeToBuffer(buffer, bufferLimit, source, sourceLimit, offsets, flush != DoNotFlush, err);
result.append(buffer, ucharsDecoded);
} while (err == U_BUFFER_OVERFLOW_ERROR);
« no previous file with comments | « Source/wtf/text/TextCodecICU.h ('k') | Source/wtf/text/TextCodecLatin1.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698