Title: [264645] trunk/Source/WebCore
Revision
264645
Author
carlo...@webkit.org
Date
2020-07-21 01:03:28 -0700 (Tue, 21 Jul 2020)

Log Message

[GTK][WPE] imported blink large gradient tests are crashing on debug builds
https://bugs.webkit.org/show_bug.cgi?id=214192

Reviewed by Žan Doberšek.

The assert is:
    ASSERT(cairo_surface_status(m_surface.get()) == CAIRO_STATUS_SUCCESS);

and the status we are getting is CAIRO_STATUS_INVALID_SIZE, because we are reaching the cairo image size
limit. We should check the size before trying to create the image surface. This patch fixes the crash, but not
the tests themselves that will still fail due to the cairo limitation.

* platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp:
(WebCore::ImageBufferCairoImageSurfaceBackend::create): Return early if the image size is bigger than the
maximum allowed by cairo.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (264644 => 264645)


--- trunk/Source/WebCore/ChangeLog	2020-07-21 07:38:54 UTC (rev 264644)
+++ trunk/Source/WebCore/ChangeLog	2020-07-21 08:03:28 UTC (rev 264645)
@@ -1,3 +1,21 @@
+2020-07-21  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [GTK][WPE] imported blink large gradient tests are crashing on debug builds
+        https://bugs.webkit.org/show_bug.cgi?id=214192
+
+        Reviewed by Žan Doberšek.
+
+        The assert is:
+            ASSERT(cairo_surface_status(m_surface.get()) == CAIRO_STATUS_SUCCESS);
+
+        and the status we are getting is CAIRO_STATUS_INVALID_SIZE, because we are reaching the cairo image size
+        limit. We should check the size before trying to create the image surface. This patch fixes the crash, but not
+        the tests themselves that will still fail due to the cairo limitation.
+
+        * platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp:
+        (WebCore::ImageBufferCairoImageSurfaceBackend::create): Return early if the image size is bigger than the
+        maximum allowed by cairo.
+
 2020-07-20  Alex Christensen  <achristen...@webkit.org>
 
         Revert r262776 for existing apps using UIWebView/WebView

Modified: trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp (264644 => 264645)


--- trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp	2020-07-21 07:38:54 UTC (rev 264644)
+++ trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp	2020-07-21 08:03:28 UTC (rev 264645)
@@ -33,6 +33,7 @@
 #if USE(CAIRO)
 
 #include "Color.h"
+#include "ImageBackingStore.h"
 #include <cairo.h>
 #include <wtf/IsoMallocInlines.h>
 
@@ -45,7 +46,7 @@
     static cairo_user_data_key_t s_surfaceDataKey;
 
     IntSize backendSize = calculateBackendSize(size, resolutionScale);
-    if (backendSize.isEmpty())
+    if (backendSize.isEmpty() || backendSize.width() > cairoMaxImageSize || backendSize.height() > cairoMaxImageSize)
         return nullptr;
 
     int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, backendSize.width());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to