From bfa44d6b007ca2e3ffabafda5beadbf102a6efdc Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Mar 2013 21:17:53 +0300 Subject: Other fixes from Coverity checks. --- src/resources/mapreader.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/resources/mapreader.cpp') diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index ec7651745..98de2cd49 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -242,10 +242,11 @@ Map *MapReader::readMap(const std::string &filename, { map->setProperty("_filename", realFilename); map->setProperty("_realfilename", filename); + + if (map->getProperty("music").empty()) + updateMusic(map); } - if (map->getProperty("music").empty()) - updateMusic(map); return map; } @@ -716,7 +717,10 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const std::string &path, doc = new XML::Document(filename); node = doc->rootNode(); if (!node) + { + delete doc; return nullptr; + } // Reset path to be realtive to the tsx file pathDir = filename.substr(0, filename.rfind("/") + 1); @@ -729,6 +733,10 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const std::string &path, { if (xmlNameEqual(childNode, "image")) { + // ignore second other tags in tileset + if (set) + continue; + const std::string source = XML::getProperty( childNode, "source", ""); -- cgit v1.2.3-70-g09d2