From 59e5c03a831e3ea4352a1b9b8e8cfd5ff7d566ed Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sun, 19 Sep 2010 23:18:29 +0200 Subject: [PATCH] Changed: #964 Fix crash with hls texture bank generation when memcpy of 0 bytes at end of allocated memory. --- code/nel/src/3d/hls_texture_bank.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/3d/hls_texture_bank.cpp b/code/nel/src/3d/hls_texture_bank.cpp index fe8eee1a5..f938a3ccd 100644 --- a/code/nel/src/3d/hls_texture_bank.cpp +++ b/code/nel/src/3d/hls_texture_bank.cpp @@ -72,9 +72,9 @@ void CHLSTextureBank::addTextureInstance(const std::string &name, uint32 color uint32 colSize= (uint32)cols.size()*sizeof(CHLSColorDelta); _TextureInstanceData.resize(_TextureInstanceData.size() + nameSize + colSize); // copy name - memcpy(&_TextureInstanceData[textInst._DataIndex], nameLwr.c_str(), nameSize); + if (nameSize != 0) memcpy(&_TextureInstanceData[textInst._DataIndex], nameLwr.c_str(), nameSize); // copy cols - memcpy(&_TextureInstanceData[textInst._DataIndex+nameSize], &cols[0], colSize); + if (colSize != 0) memcpy(&_TextureInstanceData[textInst._DataIndex+nameSize], &cols[0], colSize); // add the instance. _TextureInstances.push_back(textInst);