mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-22 23:41:01 +01:00
Validate that a binding offset fits in the buffer
This commit is contained in:
1 parent
58fe7eac48
commit
37755b6985
1 file changed
+10
-1
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user