Skip to content

Commit

Permalink
Cherry-pick 54408f5. rdar://problem/109368007
Browse files Browse the repository at this point in the history
    [WebGPU] RemoteBuffer unmap should check the input vector
    https://bugs.webkit.org/show_bug.cgi?id=255350
    <rdar://107947502>

    Reviewed by Myles C. Maxfield.

    Ensure data vector passed to unmap is valid for the currently
    mapped buffer.

    * Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp:
    (WebKit::RemoteBuffer::unmap):

    Canonical link: https://commits.webkit.org/262895@main

Identifier: 245886.885@safari-7613.4.1.0-branch
  • Loading branch information
mwyrzykowski authored and MyahCobbs committed Jun 22, 2023
1 parent fb80de3 commit 1eedcf8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Source/WebKit/GPUProcess/graphics/WebGPU/RemoteBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void RemoteBuffer::mapAsync(PAL::WebGPU::MapModeFlags mapModeFlags, std::optiona

void RemoteBuffer::unmap(Vector<uint8_t>&& data)
{
if (!m_mappedRange)
if (!m_mappedRange || m_mappedRange->byteLength < data.size())
return;
ASSERT(m_isMapped);

Expand Down

0 comments on commit 1eedcf8

Please sign in to comment.