Skip to content

Commit

Permalink
[WebGPU] Crash in WebCore::GPUCanvasContextCocoa::prepareForDisplay
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=269584
<radar://123018719>

Reviewed by Tadeu Zagallo.

Vector overflow crash reported, only visible index operator
inside the callback is this line.

* Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm:
(WebCore::GPUCanvasContextCocoa::prepareForDisplay):

Canonical link: https://commits.webkit.org/274864@main
  • Loading branch information
mwyrzykowski committed Feb 16, 2024
1 parent 95241f7 commit 87647c7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/WebCore/html/canvas/GPUCanvasContextCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ static GPUIntegerCoordinate getCanvasHeight(const GPUCanvasContext::CanvasType&
ASSERT(m_configuration->frameCount < m_configuration->renderBuffers.size());

m_compositorIntegration->prepareForDisplay([&] {
if (m_configuration->frameCount >= m_configuration->renderBuffers.size())
return;
m_layerContentsDisplayDelegate->setDisplayBuffer(m_configuration->renderBuffers[m_configuration->frameCount]);
m_compositingResultsNeedsUpdating = false;
m_configuration->frameCount = (m_configuration->frameCount + 1) % m_configuration->renderBuffers.size();
Expand Down

0 comments on commit 87647c7

Please sign in to comment.