mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
Validate that a binding offset fits in the buffer
This commit is contained in:
parent
58fe7eac48
commit
37755b6985
@ -1832,7 +1832,16 @@ impl<A: HalApi> Device<A> {
|
||||
}
|
||||
(size.get(), end)
|
||||
}
|
||||
None => (buffer.size - bb.offset, buffer.size),
|
||||
None => {
|
||||
if buffer.size < bb.offset {
|
||||
return Err(Error::BindingRangeTooLarge {
|
||||
buffer: bb.buffer_id,
|
||||
range: bb.offset..bb.offset,
|
||||
size: buffer.size,
|
||||
});
|
||||
}
|
||||
(buffer.size - bb.offset, buffer.size)
|
||||
}
|
||||
};
|
||||
|
||||
if bind_size > range_limit as u64 {
|
||||
|
Loading…
Reference in New Issue
Block a user