diff options
author | ExMix <rahuba.youri@mapswithme.com> | 2014-03-31 12:29:27 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:14:03 +0300 |
commit | 9a103a44e16b01bd1094e8a5f021dd540a8e1fa7 (patch) | |
tree | 2a509ddbf11a42e1f9658e1728fa4e72b8afd138 /drape/symbols_texture.cpp | |
parent | eadb16327799177dedf1c5a2a89b1220ab2c89a0 (diff) |
[drape] review and crash fix
Diffstat (limited to 'drape/symbols_texture.cpp')
-rw-r--r-- | drape/symbols_texture.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/drape/symbols_texture.cpp b/drape/symbols_texture.cpp index 34327a3a76..25f8909513 100644 --- a/drape/symbols_texture.cpp +++ b/drape/symbols_texture.cpp @@ -22,13 +22,23 @@ const string & SymbolsTexture::SymbolKey::GetSymbolName() const void SymbolsTexture::Load(const string & skinPathName) { uint32_t width, height; - m_desc.Load(skinPathName + ".sdf", width, height); - - ReaderPtr<ModelReader> reader = GetPlatform().GetReader(skinPathName + ".png"); - uint64_t size = reader.Size(); vector<unsigned char> rawData; - rawData.resize(size); - reader.Read(0, &rawData[0], size); + + try + { + m_desc.Load(skinPathName + ".sdf", width, height); + ReaderPtr<ModelReader> reader = GetPlatform().GetReader(skinPathName + ".png"); + uint64_t size = reader.Size(); + rawData.resize(size); + reader.Read(0, &rawData[0], size); + } + catch (RootException & e) + { + LOG(LERROR, (e.what())); + int32_t alfaTexture = 0; + Create(1, 1, Texture::RGBA8, MakeStackRefPointer(&alfaTexture)); + return; + } vector<unsigned char> pngData; unsigned w, h; |