Added error detection

Former-commit-id: f105f9bb1a31769844076a1053968a047cff89fc
This commit is contained in:
Lynix 2013-08-16 00:24:16 +02:00
parent dc2762aade
commit 3569ef531f
1 changed files with 7 additions and 1 deletions

View File

@ -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