aboutsummaryrefslogtreecommitdiff
path: root/graphics/fonts
diff options
context:
space:
mode:
authorEugene Sandulenko2017-01-23 20:27:00 +0100
committerEugene Sandulenko2017-01-23 20:27:00 +0100
commit7396965005667e2104473af57de34de8b93a1350 (patch)
treebca95ac3f64440dc2e15db7cd6bdd4240f52a042 /graphics/fonts
parent1caaf49f20ebbe44c8fb116144fca1f85ae1bae3 (diff)
downloadscummvm-rg350-7396965005667e2104473af57de34de8b93a1350.tar.gz
scummvm-rg350-7396965005667e2104473af57de34de8b93a1350.tar.bz2
scummvm-rg350-7396965005667e2104473af57de34de8b93a1350.zip
GRAPHICS: Fix number of memory leaks and wanrings
Diffstat (limited to 'graphics/fonts')
-rw-r--r--graphics/fonts/macfont.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/graphics/fonts/macfont.cpp b/graphics/fonts/macfont.cpp
index f20b64eb63..41b5df8b74 100644
--- a/graphics/fonts/macfont.cpp
+++ b/graphics/fonts/macfont.cpp
@@ -86,6 +86,7 @@ MacFontFamily::MacFontFamily() {
_ffNumOffsets = 0;
_ffOffsets = nullptr;
_ffNumBBoxes = 0;
+ _ffNumKerns = 0;
}
MacFontFamily::~MacFontFamily() {
@@ -185,7 +186,7 @@ bool MacFontFamily::load(Common::SeekableReadStream &stream) {
_ffKernEntries[i]._entryLength = stream.readUint16BE();
_ffKernEntries[i]._kernPairs.resize(_ffKernEntries[i]._entryLength);
- debug(10, " style: %x kernpairs: %d", _ffKernEntries[i]._style, _ffKernEntries[i]._entryLength);
+ debug(10, " style: %x kernpairs: %u", _ffKernEntries[i]._style, _ffKernEntries[i]._entryLength);
for (uint j = 0; j < _ffKernEntries[i]._entryLength; j++) {
byte f, s;
@@ -283,7 +284,7 @@ bool MacFONTFont::loadFont(Common::SeekableReadStream &stream, MacFontFamily *fa
_data._glyphs.resize(glyphCount);
// Bit image table
- uint16 bitImageSize = _data._rowWords * _data._fRectHeight;
+ uint bitImageSize = _data._rowWords * _data._fRectHeight;
_data._bitImage = new byte[bitImageSize];
stream.read(_data._bitImage, bitImageSize);
@@ -333,6 +334,8 @@ bool MacFONTFont::loadFont(Common::SeekableReadStream &stream, MacFontFamily *fa
stream.readUint16BE();
}
+ free(bitmapOffsets);
+
return true;
}