Merge pull request #3946 from mahiuchun/safe
glTF2: Make handling of embedded textures safer.pull/3961/head^2
commit
43a5c6c8e3
|
@ -515,9 +515,8 @@ void glTF2Exporter::GetMatTex(const aiMaterial* mat, Ref<Texture>& texture, aiTe
|
|||
std::string imgId = mAsset->FindUniqueID("", "image");
|
||||
texture->source = mAsset->images.Create(imgId);
|
||||
|
||||
if (path[0] == '*') { // embedded
|
||||
aiTexture* curTex = mScene->mTextures[atoi(&path[1])];
|
||||
|
||||
const aiTexture* curTex = mScene->GetEmbeddedTexture(path.c_str());
|
||||
if (curTex != nullptr) { // embedded
|
||||
texture->source->name = curTex->mFilename.C_Str();
|
||||
|
||||
//basisu: embedded ktx2, bu
|
||||
|
|
Loading…
Reference in New Issue