Title: [97132] trunk/Source/WebCore
Revision
97132
Author
[email protected]
Date
2011-10-11 01:28:00 -0700 (Tue, 11 Oct 2011)

Log Message

Fix crash with toDataURL to JPEG
https://bugs.webkit.org/show_bug.cgi?id=69681

Patch by John Bauman <[email protected]> on 2011-10-11
Reviewed by Kenneth Russell.

Move RefPtr declaration outside if to make sure image data still
exists through CGImageToDataURL.

* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::toDataURL):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97131 => 97132)


--- trunk/Source/WebCore/ChangeLog	2011-10-11 07:54:33 UTC (rev 97131)
+++ trunk/Source/WebCore/ChangeLog	2011-10-11 08:28:00 UTC (rev 97132)
@@ -1,3 +1,16 @@
+2011-10-11  John Bauman  <[email protected]>
+
+        Fix crash with toDataURL to JPEG
+        https://bugs.webkit.org/show_bug.cgi?id=69681
+
+        Reviewed by Kenneth Russell.
+
+        Move RefPtr declaration outside if to make sure image data still
+        exists through CGImageToDataURL.
+
+        * platform/graphics/cg/ImageBufferCG.cpp:
+        (WebCore::ImageBuffer::toDataURL):
+
 2011-10-10  Adam Barth  <[email protected]>
 
         Update test results.

Modified: trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp (97131 => 97132)


--- trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2011-10-11 07:54:33 UTC (rev 97131)
+++ trunk/Source/WebCore/platform/graphics/cg/ImageBufferCG.cpp	2011-10-11 08:28:00 UTC (rev 97132)
@@ -361,10 +361,11 @@
     RetainPtr<CGImageRef> image;
     RetainPtr<CFStringRef> uti = utiFromMIMEType(mimeType);
     ASSERT(uti);
+    RefPtr<ByteArray> arr;
 
     if (CFEqual(uti.get(), jpegUTI())) {
         // JPEGs don't have an alpha channel, so we have to manually composite on top of black.
-        RefPtr<ByteArray> arr = getPremultipliedImageData(IntRect(IntPoint(0, 0), m_size));
+        arr = getPremultipliedImageData(IntRect(IntPoint(0, 0), m_size));
 
         unsigned char *data = ""
         for (int i = 0; i < width() * height(); i++)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to