mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-20 13:53:14 +01:00
Fixed dynamic buffer overrun. Issue #760.
This commit is contained in:
@@ -2535,7 +2535,10 @@ namespace bgfx
|
||||
}
|
||||
|
||||
uint32_t offset = (dvb.m_startVertex + _startVertex)*dvb.m_stride;
|
||||
uint32_t size = bx::uint32_min(bx::uint32_satsub(dvb.m_size, _startVertex*dvb.m_stride), _mem->size);
|
||||
uint32_t size = bx::uint32_min(offset
|
||||
+ bx::uint32_min(bx::uint32_satsub(dvb.m_size, _startVertex*dvb.m_stride), _mem->size)
|
||||
, BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE) - offset
|
||||
;
|
||||
BX_CHECK(_mem->size <= size, "Truncating dynamic vertex buffer update (size %d, mem size %d)."
|
||||
, dvb.m_size
|
||||
, _mem->size
|
||||
|
||||
Reference in New Issue
Block a user