mirror of
https://github.com/overte-org/overte.git
synced 2025-04-14 04:07:11 +02:00
Prevent name collisions in KTX from causing crashes
This commit is contained in:
parent
e7a23e219d
commit
cd8f3e1b01
2 changed files with 4 additions and 2 deletions
|
@ -117,6 +117,9 @@ ktx::KTXUniquePointer Texture::serialize(const Texture& texture) {
|
|||
}
|
||||
|
||||
auto ktxBuffer = ktx::KTX::create(header, images);
|
||||
auto expectedMipCount = texture.evalNumMips();
|
||||
assert(expectedMipCount == ktxBuffer->_images.size());
|
||||
assert(expectedMipCount == header.numberOfMipmapLevels);
|
||||
|
||||
assert(0 == memcmp(&header, ktxBuffer->getHeader(), sizeof(ktx::Header)));
|
||||
assert(ktxBuffer->_images.size() == images.size());
|
||||
|
|
|
@ -103,8 +103,7 @@ gpu::Texture* cacheTexture(const std::string& name, gpu::Texture* srcTexture, bo
|
|||
}
|
||||
});
|
||||
|
||||
std::string cleanedName = name;
|
||||
cleanedName = cleanedName.substr(cleanedName.find_last_of((char) '//') + 1);
|
||||
std::string cleanedName = QUrl::toPercentEncoding(name.c_str()).toStdString();
|
||||
std::string cacheFilename(ktxCacheFolder.toStdString());
|
||||
cacheFilename += "/";
|
||||
cacheFilename += cleanedName;
|
||||
|
|
Loading…
Reference in a new issue