Added error detection
Former-commit-id: f105f9bb1a31769844076a1053968a047cff89fc
This commit is contained in:
parent
dc2762aade
commit
3569ef531f
|
|
@ -122,10 +122,16 @@ void* NzIndexBuffer::Map(nzBufferAccess access, unsigned int startIndex, unsigne
|
|||
void* NzIndexBuffer::MapRaw(nzBufferAccess access, unsigned int offset, unsigned int size)
|
||||
{
|
||||
#if NAZARA_UTILITY_SAFE
|
||||
if (!m_buffer)
|
||||
{
|
||||
NazaraError("No buffer");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (m_startOffset + offset + size > m_endOffset)
|
||||
{
|
||||
NazaraError("Exceeding virtual buffer size");
|
||||
return false;
|
||||
return nullptr;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue