[Scummvm-git-logs] scummvm master -> bff97c6edc65f984485531335c8fa494ffc8d98d
kelmer44
noreply at scummvm.org
Wed Jun 3 11:46:49 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
bff97c6edc PELROCK: Fix remaining PVS-Studio issues. PVS-Studio V557, V575, V769, V701
Commit: bff97c6edc65f984485531335c8fa494ffc8d98d
https://github.com/scummvm/scummvm/commit/bff97c6edc65f984485531335c8fa494ffc8d98d
Author: kelmer (kelmer at gmail.com)
Date: 2026-06-03T13:46:42+02:00
Commit Message:
PELROCK: Fix remaining PVS-Studio issues. PVS-Studio V557, V575, V769, V701
Changed paths:
engines/pelrock/pelrock.cpp
engines/pelrock/sound.cpp
engines/pelrock/util.cpp
diff --git a/engines/pelrock/pelrock.cpp b/engines/pelrock/pelrock.cpp
index 6299c1daf93..de64f32b278 100644
--- a/engines/pelrock/pelrock.cpp
+++ b/engines/pelrock/pelrock.cpp
@@ -2127,7 +2127,7 @@ void PelrockEngine::endingScene() {
idleAnim.animData[0] = new byte[sprite->stride];
extractSingleFrame(legsAnimData, idleAnim.animData[0], 0, sprite->w, sprite->h);
sprite->animData[0] = idleAnim;
- sprite->animData[1] = mainAnim;
+ sprite->animData[1] = mainAnim; //-V557
} else {
sprite->animData[0] = mainAnim;
}
diff --git a/engines/pelrock/sound.cpp b/engines/pelrock/sound.cpp
index 2ea43433f2a..940a1336a24 100644
--- a/engines/pelrock/sound.cpp
+++ b/engines/pelrock/sound.cpp
@@ -184,6 +184,7 @@ int SoundManager::playSound(SonidoFile sound, int channel, int loopCount) {
sonidosFile.read(data, sound.size);
sonidosFile.close();
+ assert(data);
SoundFormat format = detectFormat(data, sound.size);
uint32 sampleRate = getSampleRate(data, format);
Audio::SeekableAudioStream *stream = nullptr;
@@ -203,7 +204,6 @@ int SoundManager::playSound(SonidoFile sound, int channel, int loopCount) {
uint32 pcmSize = sound.size - headerSize;
byte *pcmData = (byte *)malloc(pcmSize);
assert(pcmData);
- assert(data);
memcpy(pcmData, data + headerSize, pcmSize);
free(data);
diff --git a/engines/pelrock/util.cpp b/engines/pelrock/util.cpp
index b9cbfef8ba9..2af0fd7f944 100644
--- a/engines/pelrock/util.cpp
+++ b/engines/pelrock/util.cpp
@@ -189,7 +189,12 @@ void readUntilBuda(Common::SeekableReadStream *stream, uint32 startPos, byte *&b
byte b = stream->readByte();
if (pos + 1 > bufferSize) {
bufferSize *= 2;
- buffer = (byte *)realloc(buffer, bufferSize);
+ byte *tmp = (byte *)realloc(buffer, bufferSize);
+ if (!tmp) {
+ free(buffer);
+ error("realloc failed in util.cpp");
+ }
+ buffer = tmp;
}
buffer[pos++] = b;
More information about the Scummvm-git-logs
mailing list