[Scummvm-git-logs] scummvm master -> fcf0a79709bdd19e43cbcfdd4ce670d7a9e76d86
elasota
noreply at scummvm.org
Mon Jul 4 20:39:08 UTC 2022
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
17671f3b2b MTROPOLIS: Fix out-of-range HR controller access
565e831ce2 MTROPOLIS: Remove unused field
73374fbf36 MTROPOLIS: Fix double-free if installer archive fails to open.
fcf0a79709 MTROPOLIS: Coverity issue cleanup
Commit: 17671f3b2bf4cf0622c6d72decdc6d1e7aa33934
https://github.com/scummvm/scummvm/commit/17671f3b2bf4cf0622c6d72decdc6d1e7aa33934
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-04T16:38:46-04:00
Commit Message:
MTROPOLIS: Fix out-of-range HR controller access
Changed paths:
engines/mtropolis/plugin/standard.cpp
diff --git a/engines/mtropolis/plugin/standard.cpp b/engines/mtropolis/plugin/standard.cpp
index 4c65750d8e3..0b0e6c070b6 100644
--- a/engines/mtropolis/plugin/standard.cpp
+++ b/engines/mtropolis/plugin/standard.cpp
@@ -700,11 +700,11 @@ void MidiCombinerDynamic::doControlChange(uint sourceID, uint8 channel, uint8 pa
doDataEntry(sourceID, channel, kMSBMask, param2);
return;
} else if (param1 < 32) {
- uint16 ctrl = ((sch._midiChannelState._hrControllers[param1 - 32] & kLSBMask) | ((param2 & 0x7f)) << 7);
+ uint16 ctrl = ((sch._midiChannelState._hrControllers[param1] & kLSBMask) | ((param2 & 0x7f)) << 7);
doHighRangeControlChange(sourceID, channel, param1, ctrl);
return;
} else if (param1 < 64) {
- uint16 ctrl = ((sch._midiChannelState._hrControllers[param1] & kMSBMask) | (param2 & 0x7f));
+ uint16 ctrl = ((sch._midiChannelState._hrControllers[param1 - 32] & kMSBMask) | (param2 & 0x7f));
doHighRangeControlChange(sourceID, channel, param1 - 32, ctrl);
return;
} else if (param1 < 96) {
Commit: 565e831ce2c6471466b7e9c09a46efac528bc738
https://github.com/scummvm/scummvm/commit/565e831ce2c6471466b7e9c09a46efac528bc738
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-04T16:38:46-04:00
Commit Message:
MTROPOLIS: Remove unused field
Changed paths:
engines/mtropolis/boot.cpp
diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index edc7414cd32..e40c144a3c4 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -136,8 +136,6 @@ private:
bool _isRetail;
bool _isEnglish;
- bool _useDynamicMidi;
-
void unpackMacRetailInstaller(Common::Array<Common::SharedPtr<ProjectPersistentResource> > &persistentResources, Common::Array<FileIdentification> &files);
Common::SharedPtr<Obsidian::WordGameData> loadWinWordGameData();
Common::SharedPtr<Obsidian::WordGameData> loadMacWordGameData();
Commit: 73374fbf367cfba276fcb80076c152ae5c492927
https://github.com/scummvm/scummvm/commit/73374fbf367cfba276fcb80076c152ae5c492927
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-04T16:38:46-04:00
Commit Message:
MTROPOLIS: Fix double-free if installer archive fails to open.
Changed paths:
engines/mtropolis/boot.cpp
diff --git a/engines/mtropolis/boot.cpp b/engines/mtropolis/boot.cpp
index e40c144a3c4..e15a4c3a832 100644
--- a/engines/mtropolis/boot.cpp
+++ b/engines/mtropolis/boot.cpp
@@ -180,13 +180,13 @@ void ObsidianGameDataHandler::unpackMacRetailInstaller(Common::Array<Common::Sha
Common::SeekableReadStream *installerDataForkStream = installerResMan->getDataFork();
- // Not counted/persisted because the StuffIt archive owns the stream
+ // Not counted/persisted because the StuffIt archive owns the stream. It will also delete it if createStuffItArchive fails.
_installerArchive.reset(Common::createStuffItArchive(installerDataForkStream));
+ installerDataForkStream = nullptr;
+
persistentResources.push_back(PersistentResource<Common::Archive>::wrap(_installerArchive));
if (!_installerArchive) {
- delete installerDataForkStream;
- installerDataForkStream = nullptr;
error("Failed to open Obsidian Installer archive");
}
Commit: fcf0a79709bdd19e43cbcfdd4ce670d7a9e76d86
https://github.com/scummvm/scummvm/commit/fcf0a79709bdd19e43cbcfdd4ce670d7a9e76d86
Author: elasota (ejlasota at gmail.com)
Date: 2022-07-04T16:38:46-04:00
Commit Message:
MTROPOLIS: Coverity issue cleanup
Changed paths:
engines/mtropolis/data.cpp
engines/mtropolis/miniscript.cpp
engines/mtropolis/modifiers.cpp
engines/mtropolis/plugin/standard.cpp
engines/mtropolis/runtime.cpp
diff --git a/engines/mtropolis/data.cpp b/engines/mtropolis/data.cpp
index fd5bff6cf19..f648c0c5f3f 100644
--- a/engines/mtropolis/data.cpp
+++ b/engines/mtropolis/data.cpp
@@ -537,7 +537,8 @@ DataObjectTypes::DataObjectType DataObject::getType() const {
return _type;
}
-ProjectLabelMap::ProjectLabelMap() : superGroups(nullptr) {
+ProjectLabelMap::ProjectLabelMap()
+ : superGroups(nullptr), persistFlags(0), unknown1(0), numSuperGroups(0), nextAvailableID(0) {
}
ProjectLabelMap::~ProjectLabelMap() {
diff --git a/engines/mtropolis/miniscript.cpp b/engines/mtropolis/miniscript.cpp
index 93c32448e4c..eae039bd0cf 100644
--- a/engines/mtropolis/miniscript.cpp
+++ b/engines/mtropolis/miniscript.cpp
@@ -1931,7 +1931,10 @@ bool MiniscriptThread::evaluateTruthOfResult(bool &isTrue) {
return false;
}
- dereferenceRValue(0, false);
+ if (!dereferenceRValue(0, false)) {
+ this->error("Failed to dereference Miniscript RValue for truth evaluation");
+ return false;
+ }
isTrue = miniscriptEvaluateTruth(_stack[0].value);
return true;
diff --git a/engines/mtropolis/modifiers.cpp b/engines/mtropolis/modifiers.cpp
index 2b223dd6e57..af7551546ee 100644
--- a/engines/mtropolis/modifiers.cpp
+++ b/engines/mtropolis/modifiers.cpp
@@ -1142,7 +1142,10 @@ const char *BoundaryDetectionMessengerModifier::getDefaultName() const {
return "Boundary Detection Messenger";
}
-CollisionDetectionMessengerModifier::CollisionDetectionMessengerModifier() : _runtime(nullptr), _isActive(false) {
+CollisionDetectionMessengerModifier::CollisionDetectionMessengerModifier()
+ : _runtime(nullptr), _isActive(false),
+ _enableWhen(Event::create()), _disableWhen(Event::create()), _detectionMode(kDetectionModeFirstContact),
+ _detectInFront(true), _detectBehind(true), _ignoreParent(true), _sendToCollidingElement(false) {
}
CollisionDetectionMessengerModifier::~CollisionDetectionMessengerModifier() {
diff --git a/engines/mtropolis/plugin/standard.cpp b/engines/mtropolis/plugin/standard.cpp
index 0b0e6c070b6..b17af3e9cf8 100644
--- a/engines/mtropolis/plugin/standard.cpp
+++ b/engines/mtropolis/plugin/standard.cpp
@@ -1408,12 +1408,14 @@ bool MediaCueMessengerModifier::load(const PlugInModifierLoaderContext &context,
if (data.enableWhen.type != Data::PlugInTypeTaggedValue::kEvent)
return false;
- _enableWhen.load(data.enableWhen.value.asEvent);
+ if (!_enableWhen.load(data.enableWhen.value.asEvent))
+ return false;
if (data.disableWhen.type != Data::PlugInTypeTaggedValue::kEvent)
return false;
- _disableWhen.load(data.disableWhen.value.asEvent);
+ if (!_disableWhen.load(data.disableWhen.value.asEvent))
+ return false;
if (data.triggerTiming.type != Data::PlugInTypeTaggedValue::kInteger)
return false;
@@ -1563,7 +1565,7 @@ void MediaCueMessengerModifier::visitInternalReferences(IStructuralReferenceVisi
_mediaCue.send.visitInternalReferences(visitor);
}
-ObjectReferenceVariableModifier::ObjectReferenceVariableModifier() {
+ObjectReferenceVariableModifier::ObjectReferenceVariableModifier() : _setToSourceParentWhen(Event::create()) {
}
bool ObjectReferenceVariableModifier::load(const PlugInModifierLoaderContext &context, const Data::Standard::ObjectReferenceVariableModifier &data) {
@@ -1960,11 +1962,14 @@ bool MidiModifier::load(const PlugInModifierLoaderContext &context, const Data::
if (data.executeWhen.type != Data::PlugInTypeTaggedValue::kEvent)
return false;
- _executeWhen.load(data.executeWhen.value.asEvent);
+ if (!_executeWhen.load(data.executeWhen.value.asEvent))
+ return false;
+
if (data.terminateWhen.type != Data::PlugInTypeTaggedValue::kEvent)
return false;
- _terminateWhen.load(data.terminateWhen.value.asEvent);
+ if (!_terminateWhen.load(data.terminateWhen.value.asEvent))
+ return false;
if (data.embeddedFlag) {
_mode = kModeFile;
diff --git a/engines/mtropolis/runtime.cpp b/engines/mtropolis/runtime.cpp
index abebdcfc820..d57bd54cac3 100644
--- a/engines/mtropolis/runtime.cpp
+++ b/engines/mtropolis/runtime.cpp
@@ -3985,20 +3985,22 @@ void Runtime::drawFrame() {
Common::Array<WindowSortingBucket> multipleBuckets;
WindowSortingBucket *sortedBuckets = &singleBucket;
- if (numWindows < 2)
+ if (numWindows < 2) {
sortedBuckets = &singleBucket;
- else {
+
+ singleBucket.originalIndex = 0;
+ singleBucket.window = _windows[0].get();
+ } else {
multipleBuckets.resize(numWindows);
sortedBuckets = &multipleBuckets[0];
- }
- for (size_t i = 0; i < numWindows; i++) {
- sortedBuckets[i].originalIndex = i;
- sortedBuckets[i].window = _windows[i].get();
- }
+ for (size_t i = 0; i < numWindows; i++) {
+ sortedBuckets[i].originalIndex = i;
+ sortedBuckets[i].window = _windows[i].get();
+ }
- if (numWindows > 1) // Quiet Coverity warning
Common::sort(sortedBuckets, sortedBuckets + numWindows, WindowSortingBucket::sortPredicate);
+ }
for (size_t i = 0; i < numWindows; i++) {
const Window &window = *sortedBuckets[i].window;
More information about the Scummvm-git-logs
mailing list