mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Merge branch 'master' of github.com:bkaradzic/bx
This commit is contained in:
@@ -401,7 +401,7 @@ namespace bx
|
||||
}
|
||||
|
||||
int64_t remainder = m_top-m_pos;
|
||||
int32_t size = uint32_min(_size, int32_t(remainder > INT32_MAX ? INT32_MAX : remainder) );
|
||||
int32_t size = uint32_min(_size, uint32_t(int64_min(remainder, INT32_MAX) ) );
|
||||
m_pos += size;
|
||||
if (size != _size)
|
||||
{
|
||||
@@ -454,7 +454,7 @@ namespace bx
|
||||
BX_CHECK(NULL != _err, "Reader/Writer interface calling functions must handle errors.");
|
||||
|
||||
int64_t remainder = m_top-m_pos;
|
||||
int32_t size = uint32_min(_size, int32_t(remainder > INT32_MAX ? INT32_MAX : remainder) );
|
||||
int32_t size = uint32_min(_size, uint32_t(int64_min(remainder, INT32_MAX) ) );
|
||||
memcpy(_data, &m_data[m_pos], size);
|
||||
m_pos += size;
|
||||
if (size != _size)
|
||||
@@ -535,7 +535,7 @@ namespace bx
|
||||
}
|
||||
|
||||
int64_t remainder = m_size-m_pos;
|
||||
int32_t size = uint32_min(_size, int32_t(remainder > INT32_MAX ? INT32_MAX : remainder) );
|
||||
int32_t size = uint32_min(_size, uint32_t(int64_min(remainder, INT32_MAX) ) );
|
||||
memcpy(&m_data[m_pos], _data, size);
|
||||
m_pos += size;
|
||||
m_top = int64_max(m_top, m_pos);
|
||||
|
||||
Reference in New Issue
Block a user