[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
commit-queue at webkit.org
commit-queue at webkit.org
Wed Dec 22 15:28:09 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 44dc9ffbbba44d6a692426fd439e12ea26dba981
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 4 08:23:21 2010 +0000
2010-11-04 Carlos Garcia Campos <cgarcia at igalia.com>
Reviewed by Martin Robinson.
[GTK] Implement unencodable characters handling in TextCodecGtk::encode()
https://bugs.webkit.org/show_bug.cgi?id=48902
Fixes a crash in test fast/encoding/char-encoding.html.
* platform/text/gtk/TextCodecGtk.cpp:
(WebCore::TextCodecGtk::encode):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71312 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3a925b9..cd22e23 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-04 Carlos Garcia Campos <cgarcia at igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Implement unencodable characters handling in TextCodecGtk::encode()
+ https://bugs.webkit.org/show_bug.cgi?id=48902
+
+ Fixes a crash in test fast/encoding/char-encoding.html.
+
+ * platform/text/gtk/TextCodecGtk.cpp:
+ (WebCore::TextCodecGtk::encode):
+
2010-11-04 Adam Barth <abarth at webkit.org>
Enabled ICCJPEG on Chromium Mac
diff --git a/WebCore/platform/text/gtk/TextCodecGtk.cpp b/WebCore/platform/text/gtk/TextCodecGtk.cpp
index bf6afcd..9308b33 100644
--- a/WebCore/platform/text/gtk/TextCodecGtk.cpp
+++ b/WebCore/platform/text/gtk/TextCodecGtk.cpp
@@ -543,9 +543,28 @@ CString TextCodecGtk::encode(const UChar* characters, size_t length, Unencodable
&error.outPtr());
input += bytesRead;
inputLength -= bytesRead;
- result.grow(size + bytesWritten);
- memcpy(result.data() + size, buffer, bytesWritten);
- size += bytesWritten;
+ if (bytesWritten > 0) {
+ result.grow(size + bytesWritten);
+ memcpy(result.data() + size, buffer, bytesWritten);
+ size += bytesWritten;
+ }
+
+ if (error && g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_INVALID_DATA)) {
+ UChar codePoint = reinterpret_cast<const UChar*>(input)[0];
+ UnencodableReplacementArray replacement;
+ int replacementLength = TextCodec::getUnencodableReplacement(codePoint, handling, replacement);
+
+ // Consume the invalid character.
+ input += sizeof(UChar);
+ inputLength -= sizeof(UChar);
+
+ // Append replacement string to result buffer.
+ result.grow(size + replacementLength);
+ memcpy(result.data() + size, replacement, replacementLength);
+ size += replacementLength;
+
+ error.clear();
+ }
} while (inputLength && !error.get());
if (error) {
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list