Skip to content

Commit

Permalink
amend! fix: always check buffer clear offset for OOB
Browse files Browse the repository at this point in the history
fix: always check buffer clear `offset` for OOB

Fuzz testing in Firefox encountered crashes for calls of
`Global::command_encoder_clear_buffer` where:

* `offset` is greater than `buffer.size`, but…
* `size` is `None`.

Oops! We should _always_ check this (i.e., even when `size` is `None`),
because we have no guarantee that `offset` and the fallback value of
`size` is in bounds. 😅 So, we change validation here to unconditionally
compute `size` and run checks we previously gated behind `if let
Some(size) = size { … }`.

For convenience, the spec. link for this method:
<https://gpuweb.github.io/gpuweb/#dom-gpucommandencoder-clearbuffer>
  • Loading branch information
ErichDonGubler committed Feb 21, 2024
1 parent cee28db commit 46b4398
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 46b4398

Please sign in to comment.