Skip to content

Commit 402caad

Browse files
committed
[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. Canonical link: https://commits.webkit.org/227391@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@264645 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent efeb801 commit 402caad

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

Source/WebCore/ChangeLog

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2020-07-21 Carlos Garcia Campos <[email protected]>
2+
3+
[GTK][WPE] imported blink large gradient tests are crashing on debug builds
4+
https://bugs.webkit.org/show_bug.cgi?id=214192
5+
6+
Reviewed by Žan Doberšek.
7+
8+
The assert is:
9+
ASSERT(cairo_surface_status(m_surface.get()) == CAIRO_STATUS_SUCCESS);
10+
11+
and the status we are getting is CAIRO_STATUS_INVALID_SIZE, because we are reaching the cairo image size
12+
limit. We should check the size before trying to create the image surface. This patch fixes the crash, but not
13+
the tests themselves that will still fail due to the cairo limitation.
14+
15+
* platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp:
16+
(WebCore::ImageBufferCairoImageSurfaceBackend::create): Return early if the image size is bigger than the
17+
maximum allowed by cairo.
18+
119
2020-07-20 Alex Christensen <[email protected]>
220

321
Revert r262776 for existing apps using UIWebView/WebView

Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#if USE(CAIRO)
3434

3535
#include "Color.h"
36+
#include "ImageBackingStore.h"
3637
#include <cairo.h>
3738
#include <wtf/IsoMallocInlines.h>
3839

@@ -45,7 +46,7 @@ std::unique_ptr<ImageBufferCairoImageSurfaceBackend> ImageBufferCairoImageSurfac
4546
static cairo_user_data_key_t s_surfaceDataKey;
4647

4748
IntSize backendSize = calculateBackendSize(size, resolutionScale);
48-
if (backendSize.isEmpty())
49+
if (backendSize.isEmpty() || backendSize.width() > cairoMaxImageSize || backendSize.height() > cairoMaxImageSize)
4950
return nullptr;
5051

5152
int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, backendSize.width());

0 commit comments

Comments
 (0)