⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 264645 in webkit


Ignore:
Timestamp:
Jul 21, 2020, 1:03:28 AM (6 years ago)
Author:
Carlos Garcia Campos
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.

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r264642 r264645  
     12020-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
     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
    1192020-07-20  Alex Christensen  <achristensen@webkit.org>
    220
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairoImageSurfaceBackend.cpp

    r264050 r264645  
    3434
    3535#include "Color.h"
     36#include "ImageBackingStore.h"
    3637#include <cairo.h>
    3738#include <wtf/IsoMallocInlines.h>
    … …  
    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
Note: See TracChangeset for help on using the changeset viewer.