From 625357685cdf78295a281a0dba6a6a3f1468d64a Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Thu, 9 Jan 2020 22:04:46 +0100 Subject: [PATCH] Update EmbedTexturesProcess.cpp closes https://github.com/assimp/assimp/issues/2874 : fix leaked texture buffer. --- code/PostProcessing/EmbedTexturesProcess.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/PostProcessing/EmbedTexturesProcess.cpp b/code/PostProcessing/EmbedTexturesProcess.cpp index 739382a05..c83738563 100644 --- a/code/PostProcessing/EmbedTexturesProcess.cpp +++ b/code/PostProcessing/EmbedTexturesProcess.cpp @@ -128,7 +128,8 @@ bool EmbedTexturesProcess::addTexture(aiScene* pScene, std::string path) const { auto oldTextures = pScene->mTextures; pScene->mTextures = new aiTexture*[pScene->mNumTextures]; ::memmove(pScene->mTextures, oldTextures, sizeof(aiTexture*) * (pScene->mNumTextures - 1u)); - + delete [] oldTextures; + // Add the new texture auto pTexture = new aiTexture; pTexture->mHeight = 0; // Means that this is still compressed