diff options
Diffstat (limited to 'engines/made/resource.cpp')
-rw-r--r-- | engines/made/resource.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/made/resource.cpp b/engines/made/resource.cpp index 28fee8ce57..f8e763e74e 100644 --- a/engines/made/resource.cpp +++ b/engines/made/resource.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -241,6 +241,7 @@ void AnimationResource::load(byte *source, int size) { /* SoundResource */ SoundResource::SoundResource() : _soundSize(0), _soundData(NULL) { + _soundEnergyArray = nullptr; } SoundResource::~SoundResource() { @@ -377,6 +378,9 @@ void GenericResource::load(byte *source, int size) { ResourceReader::ResourceReader() { _isV1 = false; _cacheDataSize = 0; + + _fd = _fdMusic = _fdPics = _fdSounds = nullptr; + _cacheCount = 0; } ResourceReader::~ResourceReader() { @@ -441,7 +445,8 @@ void ResourceReader::openResourceBlocks() { } void ResourceReader::openResourceBlock(const char *filename, Common::File *blockFile, uint32 resType) { - blockFile->open(filename); + if (!blockFile->open(filename)) + error("Failed to open '%s'", filename); blockFile->readUint16LE(); // Skip unused uint16 count = blockFile->readUint16LE(); |