Commit Graph
1 Commits
Author SHA1 Message Date
Xida Chen 361da058af Bug 1585142 [wpt PR 19413] - [OT-PW] Fixes crash when drawing patterns, a=testonly
Automatic update from web-platform-tests
[OT-PW] Fixes crash when drawing patterns

Right now the PaintWorkletDeferredImage keeps a scoped_refptr to the
PaintWorkletInput, and during the CreateShader function, the ownership
of that PaintWorkletInput is given to a PaintImage, which is then used
to create a PaintShader.

Notice that the CreateShader function can be called multiple times,
and in this case the PaintWorkletInput is nullptr after the first call.
And then it triggers a crash in PaintShader::MakeImage.

To fix this, we make the PaintWorkletDeferredImage keeps a PaintImage
which would always own the PaintWorkletInput that is passed to it.
When CreateShader is called, we can use the PaintImage to build the
shader.

A layout test is added to ensure there is no crash.

Bug: 1009450
Change-Id: I8fa5f45728884fe213176b4f5490329259a19a27
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1831790
Reviewed-by: Stephen McGruer <[email protected]>
Reviewed-by: Rune Lillesveen <[email protected]>
Commit-Queue: Xida Chen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#702392}

--

wpt-commits: 66a2fe2ae02b32e910ff091904653e62ec0c9060
wpt-pr: 19413
2019-10-14 11:23:42 +00:00