Small bug when accessing inexisting storage from the Pixels

This commit is contained in:
samcake 2017-02-17 16:05:11 -08:00
parent 6882832abd
commit 94960a7a80
2 changed files with 4 additions and 2 deletions

View file

@ -127,7 +127,9 @@ Texture::Pixels::Pixels(const Element& format, Size size, const Byte* bytes) :
}
Texture::Pixels::~Pixels() {
Texture::updateTextureCPUMemoryUsage(_storage->size(), 0);
if (_storage) {
Texture::updateTextureCPUMemoryUsage(_storage->size(), 0);
}
}
void Texture::Storage::assignTexture(Texture* texture) {

View file

@ -85,7 +85,7 @@ QImage processSourceImage(const QImage& srcImage, bool cubemap) {
return srcImage;
}
gpu::Texture* cacheTexture(const std::string& name, gpu::Texture* srcTexture, bool write = true, bool read = true) {
gpu::Texture* cacheTexture(const std::string& name, gpu::Texture* srcTexture, bool write = true, bool read = false) {
if (!srcTexture) {
return nullptr;
}