[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 13:22:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d9288ed61d17362329278182f4eb66e58c18d8eb
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 13 10:15:35 2010 +0000

    2010-09-13  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] Don't add empty strings to list of supported image MIME types
            https://bugs.webkit.org/show_bug.cgi?id=45643
    
            After <http://trac.webkit.org/changeset/67355> getMIMETypeForExtension()
            returns an empty string instead of "application/octet-stream" for unsupported
            extensions. Don't add these to the list of supported types, and clean out
            the logic that removed "application/octet-stream" from supported types.
    
            Fixes crash in initializeMIMETypeRegistry() due to inserting String() into
            a HashSet<String>.
    
            * platform/MIMETypeRegistry.cpp:
            (WebCore::initializeSupportedImageMIMETypes):
            (WebCore::initializeSupportedImageMIMETypesForEncoding):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67375 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e81cb38..9ded099 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2010-09-13  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] Don't add empty strings to list of supported image MIME types
+        https://bugs.webkit.org/show_bug.cgi?id=45643
+
+        After <http://trac.webkit.org/changeset/67355> getMIMETypeForExtension()
+        returns an empty string instead of "application/octet-stream" for unsupported
+        extensions. Don't add these to the list of supported types, and clean out
+        the logic that removed "application/octet-stream" from supported types.
+
+        Fixes crash in initializeMIMETypeRegistry() due to inserting String() into
+        a HashSet<String>.
+
+        * platform/MIMETypeRegistry.cpp:
+        (WebCore::initializeSupportedImageMIMETypes):
+        (WebCore::initializeSupportedImageMIMETypesForEncoding):
+
 2010-09-13  Adam Barth  <abarth at webkit.org>
 
         Attempted Qt build fix.
diff --git a/WebCore/platform/MIMETypeRegistry.cpp b/WebCore/platform/MIMETypeRegistry.cpp
index 9842d8c..2002018 100644
--- a/WebCore/platform/MIMETypeRegistry.cpp
+++ b/WebCore/platform/MIMETypeRegistry.cpp
@@ -102,12 +102,11 @@ static void initializeSupportedImageMIMETypes()
             continue;
 #endif
         String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
-        supportedImageMIMETypes->add(mimeType);
-        supportedImageResourceMIMETypes->add(mimeType);
+        if (!mimeType.isEmpty()) {
+            supportedImageMIMETypes->add(mimeType);
+            supportedImageResourceMIMETypes->add(mimeType);
+        }
     }
-
-    supportedImageMIMETypes->remove("application/octet-stream");
-    supportedImageResourceMIMETypes->remove("application/octet-stream");
 #else
     // assume that all implementations at least support the following standard
     // image types:
@@ -152,10 +151,9 @@ static void initializeSupportedImageMIMETypesForEncoding()
     QList<QByteArray> formats = QImageWriter::supportedImageFormats();
     for (int i = 0; i < formats.size(); ++i) {
         String mimeType = MIMETypeRegistry::getMIMETypeForExtension(formats.at(i).constData());
-        supportedImageMIMETypesForEncoding->add(mimeType);
+        if (!mimeType.isEmpty())
+            supportedImageMIMETypesForEncoding->add(mimeType);
     }
-
-    supportedImageMIMETypesForEncoding->remove("application/octet-stream");
 #elif PLATFORM(GTK)
     supportedImageMIMETypesForEncoding->add("image/png");
     supportedImageMIMETypesForEncoding->add("image/jpeg");

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list