RFR: 8347937: Canvas pattern test fails and crashes on WebKit 620.1

Jay Bhaskar jbhaskar at openjdk.org
Fri Mar 21 08:21:47 UTC 2025


Issue: 
Ref: Webkit 619.1 javafx.web/src/main/native/Source/WebCore/platform/graphics/ImageSource.cpp refactoring in 620.1
In the case of the canvas pattern using a transform property filled with an SVGMatrix()
created by an SVG element, `frame.m_nativeImage->size()` calls `NativeImage::size()`
from NativeImageJava.cpp. In this scenario, `*m_platformImage->getImage().get()` may be invalid,
as the image decoder has already populated `frame.m_size` during image metadata caching.

Solution:
To avoid potential invalid accesses and unintended size resets, only update `m_size`
if the frame does not already have a valid native image.

-------------

Commit messages:
 - 8347937: Canvas pattern test fails and crashes on WebKit 620.1

Changes: https://git.openjdk.org/jfx/pull/1740/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=1740&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8347937
  Stats: 20 lines in 2 files changed: 18 ins; 2 del; 0 mod
  Patch: https://git.openjdk.org/jfx/pull/1740.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/1740/head:pull/1740

PR: https://git.openjdk.org/jfx/pull/1740


More information about the openjfx-dev mailing list