Title: [152416] trunk/Source/WebCore
Revision
152416
Author
[email protected]
Date
2013-07-05 08:02:22 -0700 (Fri, 05 Jul 2013)

Log Message

Segmentation fault occurred when ICU data library doesn't embed the expected encoding.
https://bugs.webkit.org/show_bug.cgi?id=118410

Patch by Benjamin Dupont <[email protected]> on 2013-07-05
Reviewed by Allan Sandfeld Jensen.

* platform/text/TextEncodingRegistry.cpp:
(WebCore::newTextCodec):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (152415 => 152416)


--- trunk/Source/WebCore/ChangeLog	2013-07-05 11:23:44 UTC (rev 152415)
+++ trunk/Source/WebCore/ChangeLog	2013-07-05 15:02:22 UTC (rev 152416)
@@ -1,3 +1,13 @@
+2013-07-05  Benjamin Dupont   <[email protected]>
+
+        Segmentation fault occurred when ICU data library doesn't embed the expected encoding.
+        https://bugs.webkit.org/show_bug.cgi?id=118410
+
+        Reviewed by Allan Sandfeld Jensen.
+
+        * platform/text/TextEncodingRegistry.cpp:
+        (WebCore::newTextCodec):
+
 2013-07-05  Denis Nomiyama  <[email protected]>
 
         [GTK] fast/text/font-kerning.html fails

Modified: trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp (152415 => 152416)


--- trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp	2013-07-05 11:23:44 UTC (rev 152415)
+++ trunk/Source/WebCore/platform/text/TextEncodingRegistry.cpp	2013-07-05 15:02:22 UTC (rev 152416)
@@ -310,9 +310,14 @@
 PassOwnPtr<TextCodec> newTextCodec(const TextEncoding& encoding)
 {
     MutexLocker lock(encodingRegistryMutex());
-
     ASSERT(textCodecMap);
     TextCodecFactory factory = textCodecMap->get(encoding.name());
+
+    if (factory.function)
+        return factory.function(encoding, factory.additionalData);
+
+    // If encoding is unavailable, we use Latin1 encoding.
+    factory = textCodecMap->get("ISO-8859-1");
     ASSERT(factory.function);
     return factory.function(encoding, factory.additionalData);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to