summaryrefslogtreecommitdiff
path: root/src/resources/atlasmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-02 21:17:53 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-02 21:17:53 +0300
commitbfa44d6b007ca2e3ffabafda5beadbf102a6efdc (patch)
tree8f5d51f3ac6486f42aa531032209a0dddcc6e45d /src/resources/atlasmanager.cpp
parent181ecd0c3bf27b47487f973fb83b988fd6ceaecf (diff)
downloadmv-bfa44d6b007ca2e3ffabafda5beadbf102a6efdc.tar.gz
mv-bfa44d6b007ca2e3ffabafda5beadbf102a6efdc.tar.bz2
mv-bfa44d6b007ca2e3ffabafda5beadbf102a6efdc.tar.xz
mv-bfa44d6b007ca2e3ffabafda5beadbf102a6efdc.zip
Other fixes from Coverity checks.
Diffstat (limited to 'src/resources/atlasmanager.cpp')
-rw-r--r--src/resources/atlasmanager.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/resources/atlasmanager.cpp b/src/resources/atlasmanager.cpp
index 9ff01b9c4..0d43d59c8 100644
--- a/src/resources/atlasmanager.cpp
+++ b/src/resources/atlasmanager.cpp
@@ -256,14 +256,15 @@ SDL_Surface *AtlasManager::createSDLAtlas(TextureAtlas *atlas)
void AtlasManager::convertAtlas(TextureAtlas *atlas)
{
+ // no check for null pointer in atlas because it was in caller
// convert surface to OpemGL image
atlas->atlasImage = imageHelper->load(atlas->surface);
Image *const image = atlas->atlasImage;
- if (image)
- {
- image->mIdPath = atlas->name;
- image->incRef();
- }
+ if (!image)
+ return;
+
+ image->mIdPath = atlas->name;
+ image->incRef();
FOR_EACH (std::vector<AtlasItem*>::iterator, it, atlas->items)
{