[Scummvm-git-logs] scummvm master -> 59231bad7f8a1ef081408bc6ddb5089ed8675d9b
sluicebox
noreply at scummvm.org
Tue Dec 5 17:27:11 UTC 2023
This automated email contains information about 13 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
01ba44a92f BACKENDS: Fix memory leak in DefaultAudioCDManager. PVS-Studio V773
8f7e84a9a9 COMMON: Fix StuffIt memory leak. PVS-Studio V773
ce7b926a1a AGOS: Fix memory leak. PVS-Studio V773
1c89c286fe BBVS: Fix memory leak. PVS-Studio V773
4618cfa3f2 CRYOMNI3D: Fix memory leak. PVS-Studio V773
ae2dad1112 DIRECTOR: Fix memory leaks. PVS-Studio V773
c15beb478a GLK: SCOTT: Fix memory leaks. PVS-Studio V773
d6ccf3afb7 GLK: Fix memory leaks. PVS-Studio V773
f1528f7df6 GRIFFON: Fix memory leaks. PVS-Studio V773
a58ec73e66 SLUDGE: Fix memory leaks on error. PVS-Studio V773
7db3665609 SWORD1: Fix memory leaks. PVS-Studio V773
cfc40066b3 TOLTECS: Fix memory leak. PVS-Studio V773
59231bad7f DREAMWEB: Fix array init. PVS-Studio V612
Commit: 01ba44a92f99ee4fecfbc7452ee6601ed6021378
https://github.com/scummvm/scummvm/commit/01ba44a92f99ee4fecfbc7452ee6601ed6021378
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:31-08:00
Commit Message:
BACKENDS: Fix memory leak in DefaultAudioCDManager. PVS-Studio V773
Changed paths:
backends/audiocd/default/default-audiocd.cpp
diff --git a/backends/audiocd/default/default-audiocd.cpp b/backends/audiocd/default/default-audiocd.cpp
index 482abf3c7f1..3988eebd8b4 100644
--- a/backends/audiocd/default/default-audiocd.cpp
+++ b/backends/audiocd/default/default-audiocd.cpp
@@ -138,11 +138,11 @@ bool DefaultAudioCDManager::play(int track, int numLoops, int startFrame, int du
bool DefaultAudioCDManager::playAbsolute(int startFrame, int numLoops, int duration, bool onlyEmulate,
Audio::Mixer::SoundType soundType, const char *cuesheet) {
- Common::File *cuefile = new Common::File();
- if (!cuefile->open(cuesheet)) {
+ Common::File cuefile;
+ if (!cuefile.open(cuesheet)) {
return false;
}
- Common::String cuestring = cuefile->readString(0, cuefile->size());
+ Common::String cuestring = cuefile.readString(0, cuefile.size());
Common::CueSheet cue(cuestring.c_str());
Common::CueSheet::CueTrack *track = cue.getTrackAtFrame(startFrame);
Commit: 8f7e84a9a9b40cdf781581ed3dfe16d6de9e3d77
https://github.com/scummvm/scummvm/commit/8f7e84a9a9b40cdf781581ed3dfe16d6de9e3d77
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:31-08:00
Commit Message:
COMMON: Fix StuffIt memory leak. PVS-Studio V773
Changed paths:
common/compression/stuffit.cpp
diff --git a/common/compression/stuffit.cpp b/common/compression/stuffit.cpp
index 217f0397b1b..4d3449f38f6 100644
--- a/common/compression/stuffit.cpp
+++ b/common/compression/stuffit.cpp
@@ -975,7 +975,7 @@ static void SIT13_CreateTree(struct SIT13Data *s, Common::BitStream8LSB *bits, s
bool StuffItArchive::decompress13(Common::SeekableReadStream *src, byte *dst, uint32 uncompressedSize) const {
Common::MemoryWriteStream out(dst, uncompressedSize);
- Common::BitStream8LSB *bits = new Common::BitStream8LSB(src);
+ Common::BitStream8LSB bits(src);
uint32 i, j;
@@ -990,7 +990,7 @@ bool StuffItArchive::decompress13(Common::SeekableReadStream *src, byte *dst, ui
s->Buffer4[i].freq = -1;
}
- j = bits->getBits<8>();
+ j = bits.getBits<8>();
i = j>>4;
if(i > 5)
return false;
@@ -1003,15 +1003,15 @@ bool StuffItArchive::decompress13(Common::SeekableReadStream *src, byte *dst, ui
}
else
{
- SIT13_CreateTree(s, bits, s->Buffer3, 0x141);
+ SIT13_CreateTree(s, &bits, s->Buffer3, 0x141);
if(j&8)
memcpy(s->Buffer3b, s->Buffer3, 0x1000*sizeof(struct SIT13Buffer));
else
- SIT13_CreateTree(s, bits, s->Buffer3b, 0x141);
+ SIT13_CreateTree(s, &bits, s->Buffer3b, 0x141);
j = (j&7)+10;
- SIT13_CreateTree(s, bits, s->Buffer2, j);
+ SIT13_CreateTree(s, &bits, s->Buffer2, j);
}
- return SIT13_Extract(s, bits, out);
+ return SIT13_Extract(s, &bits, out);
}
#define OUTPUT_VAL(x) \
Commit: ce7b926a1ac245e67ea8204f64f6ff798010b37a
https://github.com/scummvm/scummvm/commit/ce7b926a1ac245e67ea8204f64f6ff798010b37a
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:31-08:00
Commit Message:
AGOS: Fix memory leak. PVS-Studio V773
Changed paths:
engines/agos/event.cpp
diff --git a/engines/agos/event.cpp b/engines/agos/event.cpp
index d83bf7794fb..e8595eb8041 100644
--- a/engines/agos/event.cpp
+++ b/engines/agos/event.cpp
@@ -477,9 +477,8 @@ void AGOSEngine::delay(uint amount) {
}
} else if (event.kbd.hasFlags(Common::KBD_CTRL)) {
if (event.kbd.keycode == Common::KEYCODE_a) {
- GUI::Dialog *_aboutDialog;
- _aboutDialog = new GUI::AboutDialog();
- _aboutDialog->runModal();
+ GUI::AboutDialog aboutDialog;
+ aboutDialog.runModal();
} else if (event.kbd.keycode == Common::KEYCODE_f) {
_fastMode = !_fastMode;
}
Commit: 1c89c286fee7d4b913f2d88bb73b6e1fa5724fa8
https://github.com/scummvm/scummvm/commit/1c89c286fee7d4b913f2d88bb73b6e1fa5724fa8
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:31-08:00
Commit Message:
BBVS: Fix memory leak. PVS-Studio V773
Changed paths:
engines/bbvs/videoplayer.cpp
diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp
index 595d32f13de..908f4788abf 100644
--- a/engines/bbvs/videoplayer.cpp
+++ b/engines/bbvs/videoplayer.cpp
@@ -35,9 +35,8 @@ void BbvsEngine::playVideo(int videoNum) {
else
videoFilename = Common::String::format("vid/video%03d.avi", videoNum - 1);
- Video::VideoDecoder *videoDecoder = new Video::AVIDecoder();
- if (!videoDecoder->loadFile(videoFilename)) {
- delete videoDecoder;
+ Video::AVIDecoder videoDecoder;
+ if (!videoDecoder.loadFile(videoFilename)) {
warning("Unable to open video %s", videoFilename.c_str());
return;
}
@@ -51,13 +50,13 @@ void BbvsEngine::playVideo(int videoNum) {
debug(0, "Screen format: %s", _system->getScreenFormat().toString().c_str());
- videoDecoder->start();
+ videoDecoder.start();
bool skipVideo = false;
- while (!shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) {
- if (videoDecoder->needsUpdate()) {
- const Graphics::Surface *frame = videoDecoder->decodeNextFrame();
+ while (!shouldQuit() && !videoDecoder.endOfVideo() && !skipVideo) {
+ if (videoDecoder.needsUpdate()) {
+ const Graphics::Surface *frame = videoDecoder.decodeNextFrame();
if (frame) {
if (frame->format.bytesPerPixel > 1) {
Graphics::Surface *frame1 = frame->convertTo(_system->getScreenFormat());
@@ -81,8 +80,6 @@ void BbvsEngine::playVideo(int videoNum) {
_system->delayMillis(10);
}
- delete videoDecoder;
-
initGraphics(320, 240);
}
Commit: 4618cfa3f248f4703461358fee4f53faa7befb65
https://github.com/scummvm/scummvm/commit/4618cfa3f248f4703461358fee4f53faa7befb65
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:31-08:00
Commit Message:
CRYOMNI3D: Fix memory leak. PVS-Studio V773
Changed paths:
engines/cryomni3d/versailles/dialogs_manager.cpp
diff --git a/engines/cryomni3d/versailles/dialogs_manager.cpp b/engines/cryomni3d/versailles/dialogs_manager.cpp
index 4d9393196db..d4cbac70498 100644
--- a/engines/cryomni3d/versailles/dialogs_manager.cpp
+++ b/engines/cryomni3d/versailles/dialogs_manager.cpp
@@ -354,21 +354,20 @@ uint Versailles_DialogsManager::askPlayerQuestions(const Common::String &video,
void Versailles_DialogsManager::loadFrame(const Common::String &video) {
Common::Path videoPath(_engine->getFilePath(kFileTypeDialAnim, video));
- Video::HNMDecoder *videoDecoder = new Video::HNMDecoder(g_system->getScreenFormat());
+ Video::HNMDecoder videoDecoder(g_system->getScreenFormat());
- if (!videoDecoder->loadFile(videoPath)) {
+ if (!videoDecoder.loadFile(videoPath)) {
warning("Failed to open movie file %s/%s", video.c_str(), videoPath.toString().c_str());
- delete videoDecoder;
return;
}
// Preload first frame to draw questions on it
- const Graphics::Surface *firstFrame = videoDecoder->decodeNextFrame();
+ const Graphics::Surface *firstFrame = videoDecoder.decodeNextFrame();
_lastImage.create(firstFrame->w, firstFrame->h, firstFrame->format);
_lastImage.blitFrom(*firstFrame);
- if (videoDecoder->hasDirtyPalette()) {
- const byte *palette = videoDecoder->getPalette();
+ if (videoDecoder.hasDirtyPalette()) {
+ const byte *palette = videoDecoder.getPalette();
_engine->setupPalette(palette, 0, 256);
}
}
Commit: ae2dad1112bed0de76c881df9d46b5f9b49b614b
https://github.com/scummvm/scummvm/commit/ae2dad1112bed0de76c881df9d46b5f9b49b614b
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:31-08:00
Commit Message:
DIRECTOR: Fix memory leaks. PVS-Studio V773
Changed paths:
engines/director/lingo/xlibs/applecdxobj.cpp
engines/director/sound.cpp
diff --git a/engines/director/lingo/xlibs/applecdxobj.cpp b/engines/director/lingo/xlibs/applecdxobj.cpp
index bf3937faa0b..2e51334c699 100644
--- a/engines/director/lingo/xlibs/applecdxobj.cpp
+++ b/engines/director/lingo/xlibs/applecdxobj.cpp
@@ -145,9 +145,9 @@ AppleCDXObject::AppleCDXObject(ObjectType ObjectType) :Object<AppleCDXObject>("A
_outpoint = 0;
_cue = nullptr;
- Common::File *cuefile = new Common::File();
- if (cuefile->open("disc.cue")) {
- Common::String cuestring = cuefile->readString(0, cuefile->size());
+ Common::File cuefile;
+ if (cuefile.open("disc.cue")) {
+ Common::String cuestring = cuefile.readString(0, cuefile.size());
_cue = new Common::CueSheet(cuestring.c_str());
}
diff --git a/engines/director/sound.cpp b/engines/director/sound.cpp
index 7534ceac630..3c15fc3d59e 100644
--- a/engines/director/sound.cpp
+++ b/engines/director/sound.cpp
@@ -596,8 +596,8 @@ void DirectorSound::playFPlaySound() {
Common::SeekableReadStreamEndian *sndData = archive->getResource(tag, id);
if (sndData != nullptr) {
- SNDDecoder *ad = new SNDDecoder();
- ad->loadStream(*sndData);
+ SNDDecoder ad;
+ ad.loadStream(*sndData);
delete sndData;
Audio::AudioStream *as;
@@ -610,7 +610,7 @@ void DirectorSound::playFPlaySound() {
// FPlay is controlled by Lingo, not the score, like a puppet,
// so we'll get the puppet version of the stream.
- as = ad->getAudioStream(looping, true);
+ as = ad.getAudioStream(looping, true);
if (!as) {
warning("DirectorSound:playFPlaySound: failed to get audio stream");
@@ -621,7 +621,6 @@ void DirectorSound::playFPlaySound() {
_currentSoundName = sndName;
playStream(*as, 1);
- delete ad;
}
// Set the last played sound so that cast member 0 in the sound channel doesn't stop this file.
Commit: c15beb478a75a475940bce01f8096f3d1b7634c1
https://github.com/scummvm/scummvm/commit/c15beb478a75a475940bce01f8096f3d1b7634c1
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:32-08:00
Commit Message:
GLK: SCOTT: Fix memory leaks. PVS-Studio V773
Changed paths:
engines/glk/scott/c64_checksums.cpp
engines/glk/scott/load_ti99_4a.cpp
diff --git a/engines/glk/scott/c64_checksums.cpp b/engines/glk/scott/c64_checksums.cpp
index a9ebe2ecba8..4471eeb71bb 100644
--- a/engines/glk/scott/c64_checksums.cpp
+++ b/engines/glk/scott/c64_checksums.cpp
@@ -258,6 +258,7 @@ void appendSIfiles(uint8_t **sf, size_t *extent) {
*extent = offset + _G(_saveIslandAppendix1Length) + _G(_saveIslandAppendix2Length);
*sf = new uint8_t[*extent];
memcpy(*sf, megabuf, *extent);
+ delete[] megabuf;
}
int mysteriousMenu(uint8_t **sf, size_t *extent, int recindex) {
@@ -424,11 +425,13 @@ int detectC64(uint8_t **sf, size_t *extent) {
memcpy(megabuf + newlength + g_C64Registry[index]._parameter, appendix + 2, appendixlen);
newlength += appendixlen;
}
+ delete[] appendix;
if (largest_file) {
*sf = megabuf;
*extent = newlength;
}
+ delete[] largest_file;
} else if (g_C64Registry[index]._type == TYPE_T64) {
uint8_t *file_records = *sf + 64;
diff --git a/engines/glk/scott/load_ti99_4a.cpp b/engines/glk/scott/load_ti99_4a.cpp
index 7dddd36c957..957b655009b 100644
--- a/engines/glk/scott/load_ti99_4a.cpp
+++ b/engines/glk/scott/load_ti99_4a.cpp
@@ -441,10 +441,11 @@ int tryLoadingTI994A(DataHeader dh, int loud) {
ct = 0;
ip = &_G(_items)[0];
- int *objectlinks = new int[ni + 1];
-
- if (seekIfNeeded(fixAddress(fixWord(dh._pObjLink)), &offset, &ptr) == 0)
+ if (seekIfNeeded(fixAddress(fixWord(dh._pObjLink)), &offset, &ptr) == 0) {
return 0;
+ }
+
+ int *objectlinks = new int[ni + 1];
do {
objectlinks[ct] = *(ptr++ - _G(_fileBaselineOffset));
@@ -459,6 +460,8 @@ int tryLoadingTI994A(DataHeader dh, int loud) {
ip++;
} while (ct < ni + 1);
+ delete[] objectlinks;
+
readTI99ImplicitActions(dh);
readTI99ExplicitActions(dh);
Commit: d6ccf3afb770840d861be08d7732e1da52bc12a5
https://github.com/scummvm/scummvm/commit/d6ccf3afb770840d861be08d7732e1da52bc12a5
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:32-08:00
Commit Message:
GLK: Fix memory leaks. PVS-Studio V773
Changed paths:
engines/glk/streams.cpp
diff --git a/engines/glk/streams.cpp b/engines/glk/streams.cpp
index d84ae4e8b14..ef39a97bce9 100644
--- a/engines/glk/streams.cpp
+++ b/engines/glk/streams.cpp
@@ -1429,18 +1429,18 @@ frefid_t Streams::createByPrompt(uint usage, FileMode fmode, uint rock) {
case fileusage_SavedGame: {
if (fmode == filemode_Write) {
// Select a savegame slot
- GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
+ GUI::SaveLoadChooser dialog(_("Save game:"), _("Save"), true);
- int slot = dialog->runModalWithCurrentTarget();
+ int slot = dialog.runModalWithCurrentTarget();
if (slot >= 0) {
- Common::String desc = dialog->getResultString();
+ Common::String desc = dialog.getResultString();
return createRef(slot, desc, usage, rock);
}
} else if (fmode == filemode_Read) {
// Load a savegame slot
- GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
+ GUI::SaveLoadChooser dialog(_("Restore game:"), _("Restore"), false);
- int slot = dialog->runModalWithCurrentTarget();
+ int slot = dialog.runModalWithCurrentTarget();
if (slot >= 0) {
return createRef(slot, "", usage, rock);
}
Commit: f1528f7df6e36549c293776a94aa8258b0cf896f
https://github.com/scummvm/scummvm/commit/f1528f7df6e36549c293776a94aa8258b0cf896f
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:32-08:00
Commit Message:
GRIFFON: Fix memory leaks. PVS-Studio V773
Changed paths:
engines/griffon/resources.cpp
diff --git a/engines/griffon/resources.cpp b/engines/griffon/resources.cpp
index fb41ba76be6..ffb9512c7a9 100644
--- a/engines/griffon/resources.cpp
+++ b/engines/griffon/resources.cpp
@@ -1101,7 +1101,7 @@ void GriffonEngine::loadItemImgs() {
temp->blendBlitTo(*_itemImg[i], 0, 0, Graphics::FLIP_NONE, &rcSrc);
}
- temp->free();
+ delete temp;
}
void GriffonEngine::loadFont() {
@@ -1128,7 +1128,7 @@ void GriffonEngine::loadFont() {
font->blendBlitTo(*_fontChr[i2][f], rcDest.left, rcDest.top, Graphics::FLIP_NONE, &rcSrc);
}
- font->free();
+ delete font;
}
void GriffonEngine::loadTiles() {
Commit: a58ec73e66069eee101c09630015d86176a9f848
https://github.com/scummvm/scummvm/commit/a58ec73e66069eee101c09630015d86176a9f848
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:32-08:00
Commit Message:
SLUDGE: Fix memory leaks on error. PVS-Studio V773
Changed paths:
engines/sludge/builtin.cpp
engines/sludge/floor.cpp
diff --git a/engines/sludge/builtin.cpp b/engines/sludge/builtin.cpp
index 00bd7a13519..4faacf3e9ef 100644
--- a/engines/sludge/builtin.cpp
+++ b/engines/sludge/builtin.cpp
@@ -824,8 +824,10 @@ builtIn(anim) {
// Only remaining parameter is the file number
int fileNumber;
- if (!fun->stack->thisVar.getValueType(fileNumber, SVT_FILE))
+ if (!fun->stack->thisVar.getValueType(fileNumber, SVT_FILE)) {
+ delete ba;
return BR_ERROR;
+ }
trimStack(fun->stack);
// Load the required sprite bank
diff --git a/engines/sludge/floor.cpp b/engines/sludge/floor.cpp
index b2636ff341d..075d11d6982 100644
--- a/engines/sludge/floor.cpp
+++ b/engines/sludge/floor.cpp
@@ -184,11 +184,13 @@ bool FloorManager::setFloor(int fileNum) {
// Now build the movement martix
_currentFloor->matrix = new int *[_currentFloor->numPolygons];
- int **distanceMatrix = new int *[_currentFloor->numPolygons];
-
if (!checkNew(_currentFloor->matrix))
return false;
+ int **distanceMatrix = new int *[_currentFloor->numPolygons];
+ if (!checkNew(distanceMatrix))
+ return false;
+
for (i = 0; i < _currentFloor->numPolygons; i++) {
_currentFloor->matrix[i] = new int[_currentFloor->numPolygons];
distanceMatrix[i] = new int[_currentFloor->numPolygons];
Commit: 7db3665609162a8c1b8f1edea50486adb9a2310b
https://github.com/scummvm/scummvm/commit/7db3665609162a8c1b8f1edea50486adb9a2310b
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:32-08:00
Commit Message:
SWORD1: Fix memory leaks. PVS-Studio V773
Changed paths:
engines/sword1/resman.cpp
diff --git a/engines/sword1/resman.cpp b/engines/sword1/resman.cpp
index 2b6b27a59eb..b2aa6712651 100644
--- a/engines/sword1/resman.cpp
+++ b/engines/sword1/resman.cpp
@@ -142,18 +142,17 @@ void ResMan::loadCluDescript(const char *fileName) {
_srIdList[cnt] = 0x04050000 | cnt;
if (_isKorTrs) {
- Common::File *cluFile = new Common::File();
- cluFile->open("korean.clu");
- if (cluFile->isOpen()) {
+ Common::File cluFile;
+ cluFile.open("korean.clu");
+ if (cluFile.isOpen()) {
for (uint32 resCnt = 0, resOffset = 0; resCnt < _prj.clu[2].grp[0].noRes; resCnt++) {
Header header;
- cluFile->read(&header, sizeof(Header));
+ cluFile.read(&header, sizeof(Header));
_prj.clu[2].grp[0].offset[resCnt] = resOffset;
_prj.clu[2].grp[0].length[resCnt] = header.comp_length;
resOffset += header.comp_length;
- cluFile->seek(header.decomp_length, SEEK_CUR);
+ cluFile.seek(header.decomp_length, SEEK_CUR);
}
- cluFile->close();
Common::strcpy_s(_prj.clu[2].label, "korean");
} else {
_isKorTrs = false;
@@ -279,12 +278,11 @@ void ResMan::resOpen(uint32 id) { // load resource ID into memory
// Load Korean Font
uint32 size = resLength(id);
uint32 korFontSize = 0;
- Common::File *korFontFile = NULL;
+ Common::File korFontFile;
- korFontFile = new Common::File();
- korFontFile->open("bs1k.fnt");
- if (korFontFile->isOpen()) {
- korFontSize = korFontFile->size();
+ korFontFile.open("bs1k.fnt");
+ if (korFontFile.isOpen()) {
+ korFontSize = korFontFile.size();
}
_memMan->alloc(memHandle, size + korFontSize);
Common::File *clusFile = resFile(id);
@@ -296,8 +294,7 @@ void ResMan::resOpen(uint32 id) { // load resource ID into memory
}
if (korFontSize > 0) {
- korFontFile->read((uint8 *)memHandle->data + size, korFontSize);
- korFontFile->close();
+ korFontFile.read((uint8 *)memHandle->data + size, korFontSize);
}
} else {
uint32 size = resLength(id);
Commit: cfc40066b39b2ae58312a2f3c85e2d008875fac1
https://github.com/scummvm/scummvm/commit/cfc40066b39b2ae58312a2f3c85e2d008875fac1
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:32-08:00
Commit Message:
TOLTECS: Fix memory leak. PVS-Studio V773
Changed paths:
engines/toltecs/menu.cpp
diff --git a/engines/toltecs/menu.cpp b/engines/toltecs/menu.cpp
index ca131ac9ce2..96f120f5eb7 100644
--- a/engines/toltecs/menu.cpp
+++ b/engines/toltecs/menu.cpp
@@ -299,12 +299,12 @@ void MenuSystem::initMenu(MenuID menuID) {
_savegames.push_back(SavegameItem(newSlotNum, Common::String::format("GAME %04d", _savegames.size())));
setSavegameCaptions(true);
} else {
- GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Save game:"), _("Save"), true);
- int slot = dialog->runModalWithCurrentTarget();
- Common::String desc = dialog->getResultString();
+ GUI::SaveLoadChooser dialog(_("Save game:"), _("Save"), true);
+ int slot = dialog.runModalWithCurrentTarget();
+ Common::String desc = dialog.getResultString();
if (desc.empty()) {
// Create our own description for the saved game, the user didn't enter one
- desc = dialog->createDefaultSaveDescription(slot);
+ desc = dialog.createDefaultSaveDescription(slot);
}
if (slot >= 0) {
Commit: 59231bad7f8a1ef081408bc6ddb5089ed8675d9b
https://github.com/scummvm/scummvm/commit/59231bad7f8a1ef081408bc6ddb5089ed8675d9b
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2023-12-05T09:24:32-08:00
Commit Message:
DREAMWEB: Fix array init. PVS-Studio V612
Changed paths:
engines/dreamweb/stubs.cpp
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 7fde37ccd59..8ed56af527e 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2911,7 +2911,7 @@ void DreamWebEngine::clearChanges() {
_vars._exFramePos = 0;
_vars._exTextPos = 0;
- memset(_exFrames._frames, 0xFF, kFrameBlocksize);
+ memset(_exFrames._frames, 0xFF, kGraphicsFileFrameSize * sizeof(Frame));
memset(_exFrames._data, 0xFF, kExframeslen);
memset(_exData, 0xFF, sizeof(_exData));
memset(_exText._offsetsLE, 0xFF, 2*(kNumexobjects+2));
More information about the Scummvm-git-logs
mailing list