Skip to content

Commit

Permalink
Merge branch 'master' into duo
Browse files Browse the repository at this point in the history
  • Loading branch information
Unreal-Dan committed Feb 23, 2025
2 parents d0fd1bc + ddec3a3 commit 123fc81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions VortexEngine/src/Serial/ByteStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ bool ByteStream::unserialize32(uint32_t *bytes)
// unserialize data and erase it from the buffer
bool ByteStream::consume8(uint8_t *bytes)
{
if (!m_pData || m_position >= m_pData->size || (m_pData->size - m_position) < sizeof(uint8_t)) {
if (!m_pData || m_pData->size < sizeof(uint8_t)) {
return false;
}
if (bytes) {
Expand All @@ -477,7 +477,7 @@ bool ByteStream::consume8(uint8_t *bytes)

bool ByteStream::consume16(uint16_t *bytes)
{
if (!m_pData || m_position >= m_pData->size || (m_pData->size - m_position) < sizeof(uint16_t)) {
if (!m_pData || m_pData->size < sizeof(uint16_t)) {
return false;
}
if (bytes) {
Expand All @@ -495,7 +495,7 @@ bool ByteStream::consume16(uint16_t *bytes)

bool ByteStream::consume32(uint32_t *bytes)
{
if (!m_pData || m_position >= m_pData->size || (m_pData->size - m_position) < sizeof(uint32_t)) {
if (!m_pData || m_pData->size < sizeof(uint32_t)) {
return false;
}
if (bytes) {
Expand Down

0 comments on commit 123fc81

Please sign in to comment.