Skip to content

Commit 4ac3757

Browse files
fixup! fix(core): validate start + size for buffer ops in more places
1 parent ab14602 commit 4ac3757

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wgpu-core/src/command/transfer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ pub(crate) fn validate_linear_texture_data(
351351
return Err(TransferError::UnspecifiedRowsPerImage);
352352
};
353353

354-
if offset >= buffer_size {
354+
if offset > buffer_size {
355355
return Err(TransferError::BufferStartOffsetOverrun {
356356
start_offset: offset,
357357
buffer_size: bytes_in_copy,
@@ -1000,7 +1000,7 @@ pub(super) fn copy_buffer_to_buffer(
10001000
let dst_barrier = dst_pending.map(|pending| pending.into_hal(dst_buffer, state.snatch_guard));
10011001

10021002
// TODO: This check isn't part of the spec., but it looks like it should be.
1003-
if source_offset >= src_buffer.size {
1003+
if source_offset > src_buffer.size {
10041004
return Err(TransferError::BufferStartOffsetOverrun {
10051005
start_offset: destination_offset,
10061006
buffer_size: dst_buffer.size,

0 commit comments

Comments
 (0)