[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

yong.li at torchmobile.com yong.li at torchmobile.com
Thu Oct 29 20:44:24 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit b364877d1da84e9166113db20aebbfe75fd3502e
Author: yong.li at torchmobile.com <yong.li at torchmobile.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Oct 14 15:48:41 2009 +0000

    2009-10-02  Yong Li  <yong.li at torchmobile.com>
    
            Reviewed by Adele Peterson.
    
            Fixed crash when loading invalid image data.
            Also added a test case that loads an invalid image to make sure
            we don't crash in this situation.
            https://bugs.webkit.org/show_bug.cgi?id=29980
    
    	WebCore:
            * rendering/RenderImage.cpp:
            (WebCore::RenderImage::setImageSizeForAltText):
    
    	LayoutTests:
            * fast/images/image-invalid-data-expected.txt: Added.
            * fast/images/image-invalid-data.html: Added.
            * fast/images/resources/invalid.jpg: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49562 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 1a015fa..6214044 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,15 @@
+2009-10-02  Yong Li  <yong.li at torchmobile.com>
+
+        Reviewed by NOBODY Adele Peterson.
+
+        Added a test case that loads an invalid image to make sure
+        we don't crash in this situation.
+        https://bugs.webkit.org/show_bug.cgi?id=29980
+
+        * fast/images/image-invalid-data-expected.txt: Added.
+        * fast/images/image-invalid-data.html: Added.
+        * fast/images/resources/invalid.jpg: Added.
+
 2009-10-09  Stephen White  <senorblanco at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/LayoutTests/fast/images/image-invalid-data-expected.txt b/LayoutTests/fast/images/image-invalid-data-expected.txt
new file mode 100644
index 0000000..a4e24cc
--- /dev/null
+++ b/LayoutTests/fast/images/image-invalid-data-expected.txt
@@ -0,0 +1,3 @@
+This is test for an image with invalid data. No crash means test PASS.
+
+
diff --git a/LayoutTests/fast/images/image-invalid-data.html b/LayoutTests/fast/images/image-invalid-data.html
new file mode 100644
index 0000000..5313b8e
--- /dev/null
+++ b/LayoutTests/fast/images/image-invalid-data.html
@@ -0,0 +1,15 @@
+<html>
+<head>
+    <script type="text/javascript">
+        if (window.layoutTestController)
+            layoutTestController.dumpAsText();
+    </script>
+</head>
+<body>
+    <p>
+        This is test for an image with invalid data. No crash means test PASS.
+    </p>
+    <hr>
+    <img src="resources/invalid.jpg"></img>
+</body>
+</html>
diff --git a/LayoutTests/fast/images/resources/invalid.jpg b/LayoutTests/fast/images/resources/invalid.jpg
new file mode 100644
index 0000000..e5b5588
--- /dev/null
+++ b/LayoutTests/fast/images/resources/invalid.jpg
@@ -0,0 +1 @@
+??????????????????????????????????????????????????????????
\ No newline at end of file
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 35ed0ab..5dff2ae 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2009-10-01  Yong Li  <yong.li at torchmobile.com>
+
+        Reviewed by Adele Peterson.
+
+        Fix crash when loading invalid image data
+        https://bugs.webkit.org/show_bug.cgi?id=29980
+
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::setImageSizeForAltText):
+
 2009-10-09  Stephen White  <senorblanco at chromium.org>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp
index 51c3073..4206b1c 100644
--- a/WebCore/rendering/RenderImage.cpp
+++ b/WebCore/rendering/RenderImage.cpp
@@ -227,7 +227,7 @@ bool RenderImage::setImageSizeForAltText(CachedImage* newImage /* = 0 */)
         imageHeight = paddingHeight;
     }
   
-    if (newImage) {
+    if (newImage && newImage->image()) {
         // imageSize() returns 0 for the error image.  We need the true size of the
         // error image, so we have to get it by grabbing image() directly.
         imageWidth += newImage->image()->width() * style()->effectiveZoom();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list