mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-12-27 02:50:53 +00:00
Changed: #964 Fix crash with hls texture bank generation when memcpy of 0 bytes at end of allocated memory.
This commit is contained in:
parent
15486b8335
commit
b9323c1321
1 changed files with 2 additions and 2 deletions
|
@ -72,9 +72,9 @@ void CHLSTextureBank::addTextureInstance(const std::string &name, uint32 color
|
||||||
uint32 colSize= (uint32)cols.size()*sizeof(CHLSColorDelta);
|
uint32 colSize= (uint32)cols.size()*sizeof(CHLSColorDelta);
|
||||||
_TextureInstanceData.resize(_TextureInstanceData.size() + nameSize + colSize);
|
_TextureInstanceData.resize(_TextureInstanceData.size() + nameSize + colSize);
|
||||||
// copy name
|
// copy name
|
||||||
memcpy(&_TextureInstanceData[textInst._DataIndex], nameLwr.c_str(), nameSize);
|
if (nameSize != 0) memcpy(&_TextureInstanceData[textInst._DataIndex], nameLwr.c_str(), nameSize);
|
||||||
// copy cols
|
// copy cols
|
||||||
memcpy(&_TextureInstanceData[textInst._DataIndex+nameSize], &cols[0], colSize);
|
if (colSize != 0) memcpy(&_TextureInstanceData[textInst._DataIndex+nameSize], &cols[0], colSize);
|
||||||
|
|
||||||
// add the instance.
|
// add the instance.
|
||||||
_TextureInstances.push_back(textInst);
|
_TextureInstances.push_back(textInst);
|
||||||
|
|
Loading…
Reference in a new issue