Title: [87629] branches/safari-534-branch/Source/WebCore
Revision
87629
Author
[email protected]
Date
2011-05-28 19:41:03 -0700 (Sat, 28 May 2011)

Log Message

Merge r87598.

Modified Paths

Diff

Modified: branches/safari-534-branch/Source/WebCore/ChangeLog (87628 => 87629)


--- branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-29 01:37:59 UTC (rev 87628)
+++ branches/safari-534-branch/Source/WebCore/ChangeLog	2011-05-29 02:41:03 UTC (rev 87629)
@@ -1,5 +1,25 @@
 2011-05-28  Mark Rowe  <[email protected]>
 
+        Merge r87598.
+
+    2011-05-27  Simon Fraser  <[email protected]>
+
+        Reviewed by Dan Bernstein.
+
+        CG BitmapImage needs to check for valid CGImage in a couple of places
+        https://bugs.webkit.org/show_bug.cgi?id=61684
+        <rdar://problem/9519348>
+
+        BitmapImage::getCGImageArray() can throw an exception if frameAtIndex()
+        returns null, which it may do if the image is corrupted or still
+        loading. Protect against that here and in getFirstCGImageRefOfSize().
+
+        * platform/graphics/cg/ImageCG.cpp:
+        (WebCore::BitmapImage::getFirstCGImageRefOfSize):
+        (WebCore::BitmapImage::getCGImageArray):
+
+2011-05-28  Mark Rowe  <[email protected]>
+
         Merge r87331.
 
     2011-05-25  Jer Noble  <[email protected]>

Modified: branches/safari-534-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp (87628 => 87629)


--- branches/safari-534-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp	2011-05-29 01:37:59 UTC (rev 87628)
+++ branches/safari-534-branch/Source/WebCore/platform/graphics/cg/ImageCG.cpp	2011-05-29 02:41:03 UTC (rev 87629)
@@ -160,7 +160,7 @@
     size_t count = frameCount();
     for (size_t i = 0; i < count; ++i) {
         CGImageRef cgImage = frameAtIndex(i);
-        if (IntSize(CGImageGetWidth(cgImage), CGImageGetHeight(cgImage)) == size)
+        if (cgImage && IntSize(CGImageGetWidth(cgImage), CGImageGetHeight(cgImage)) == size)
             return cgImage;
     }
 
@@ -175,9 +175,10 @@
         return 0;
     
     CFMutableArrayRef array = CFArrayCreateMutable(NULL, count, &kCFTypeArrayCallBacks);
-    for (size_t i = 0; i < count; ++i)
-        CFArrayAppendValue(array, frameAtIndex(i));
-        
+    for (size_t i = 0; i < count; ++i) {
+        if (CGImageRef currFrame = frameAtIndex(i))
+            CFArrayAppendValue(array, currFrame);
+    }
     return RetainPtr<CFArrayRef>(AdoptCF, array);
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to