[Scummvm-cvs-logs] scummvm master -> 506549ae45e09b9c4c0c9c786077c429533ce53c

sev- sev at scummvm.org
Sat May 28 15:26:45 CEST 2016


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
829e62a9fe GROOVIE: Clean initialization for few classes
b16c5439b0 PARALLACTION: Cleanup object initialization
506549ae45 PARALLACTION: Safer string manipulation


Commit: 829e62a9feac71bb2fc195c31604d9eca39d962b
    https://github.com/scummvm/scummvm/commit/829e62a9feac71bb2fc195c31604d9eca39d962b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-28T15:26:31+02:00

Commit Message:
GROOVIE: Clean initialization for few classes

Changed paths:
    engines/groovie/cell.cpp
    engines/groovie/cursor.cpp
    engines/groovie/font.h
    engines/groovie/graphics.cpp
    engines/groovie/music.cpp
    engines/groovie/music.h
    engines/groovie/player.cpp



diff --git a/engines/groovie/cell.cpp b/engines/groovie/cell.cpp
index 24fac17..5fceb8f 100644
--- a/engines/groovie/cell.cpp
+++ b/engines/groovie/cell.cpp
@@ -30,6 +30,7 @@ CellGame::CellGame() {
 	_stack_index = _boardStackPtr = 0;
 	_flag4 = false;
 	_flag2 = false;
+	_flag1 = false;
 	_coeff3 = 0;
 
 	_moveCount = 0;
diff --git a/engines/groovie/cursor.cpp b/engines/groovie/cursor.cpp
index 442f0bf..d566980 100644
--- a/engines/groovie/cursor.cpp
+++ b/engines/groovie/cursor.cpp
@@ -35,7 +35,7 @@ namespace Groovie {
 // Cursor Manager
 
 GrvCursorMan::GrvCursorMan(OSystem *system) :
-	_syst(system), _lastTime(0), _current(255), _cursor(NULL) {
+	_syst(system), _lastTime(0), _current(255), _cursor(NULL), _lastFrame(0) {
 }
 
 GrvCursorMan::~GrvCursorMan() {
diff --git a/engines/groovie/font.h b/engines/groovie/font.h
index 23e060f..5c479b6 100644
--- a/engines/groovie/font.h
+++ b/engines/groovie/font.h
@@ -44,7 +44,7 @@ private:
 	int _maxHeight, _maxWidth;
 
 	struct Glyph {
-		Glyph() : pixels(0) {}
+		Glyph() : pixels(0), width(0), height(0), julia(0) {}
 		~Glyph() { delete[] pixels; }
 
 		byte width;
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp
index e0c198f..4595641 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -31,7 +31,7 @@
 namespace Groovie {
 
 GraphicsMan::GraphicsMan(GroovieEngine *vm) :
-	_vm(vm), _changed(false), _fading(0) {
+	_vm(vm), _changed(false), _fading(0), _fadeStartTime(0) {
 	// Create the game surfaces
 	_foreground.create(640, 320, _vm->_pixelFormat);
 	_background.create(640, 320, _vm->_pixelFormat);
diff --git a/engines/groovie/music.cpp b/engines/groovie/music.cpp
index cf65e01..9244dd7 100644
--- a/engines/groovie/music.cpp
+++ b/engines/groovie/music.cpp
@@ -44,7 +44,8 @@ namespace Groovie {
 
 MusicPlayer::MusicPlayer(GroovieEngine *vm) :
 	_vm(vm), _isPlaying(false), _backgroundFileRef(0), _gameVolume(100),
-	_prevCDtrack(0), _backgroundDelay(0) {
+	_prevCDtrack(0), _backgroundDelay(0), _fadingStartTime(0), _fadingStartVolume(0),
+	_fadingEndVolume(0), _fadingDuration(0), _userVolume(0) {
 }
 
 MusicPlayer::~MusicPlayer() {
@@ -391,6 +392,8 @@ MusicPlayerXMI::MusicPlayerXMI(GroovieEngine *vm, const Common::String &gtlName)
 	bool milesAudioEnabled = true;
 	MidiParser::XMidiNewTimbreListProc newTimbreListProc = NULL;
 
+	_musicType = 0;
+
 	if (milesAudioEnabled) {
 		// 7th Guest uses FAT.AD/FAT.OPL/FAT.MT
 		// 11th Hour uses SAMPLE.AD/SAMPLE.OPL/SAMPLE.MT
diff --git a/engines/groovie/music.h b/engines/groovie/music.h
index c549527..8b46cdd 100644
--- a/engines/groovie/music.h
+++ b/engines/groovie/music.h
@@ -141,7 +141,7 @@ private:
 	// Timbres
 	class Timbre {
 	public:
-		Timbre() : data(NULL) {}
+		Timbre() : data(NULL), patch(0), bank(0), size(0) {}
 		byte patch;
 		byte bank;
 		uint32 size;
diff --git a/engines/groovie/player.cpp b/engines/groovie/player.cpp
index dea3238..bbc8918 100644
--- a/engines/groovie/player.cpp
+++ b/engines/groovie/player.cpp
@@ -29,7 +29,8 @@
 namespace Groovie {
 
 VideoPlayer::VideoPlayer(GroovieEngine *vm) :
-	_vm(vm), _syst(vm->_system), _file(NULL), _audioStream(NULL), _fps(0), _overrideSpeed(false) {
+	_vm(vm), _syst(vm->_system), _file(NULL), _audioStream(NULL), _fps(0), _overrideSpeed(false), _flags(0),
+	_begunPlaying(false), _millisBetweenFrames(0), _lastFrameTime(0) {
 }
 
 bool VideoPlayer::load(Common::SeekableReadStream *file, uint16 flags) {


Commit: b16c5439b0888bab10a8306660b56742f31d761a
    https://github.com/scummvm/scummvm/commit/b16c5439b0888bab10a8306660b56742f31d761a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-28T15:26:31+02:00

Commit Message:
PARALLACTION: Cleanup object initialization

Changed paths:
    engines/parallaction/adlib.cpp
    engines/parallaction/balloons.cpp
    engines/parallaction/debug.cpp
    engines/parallaction/dialogue.cpp
    engines/parallaction/disk_br.cpp
    engines/parallaction/disk_ns.cpp
    engines/parallaction/exec.cpp
    engines/parallaction/font.cpp
    engines/parallaction/gfxbase.cpp
    engines/parallaction/graphics.cpp
    engines/parallaction/graphics.h
    engines/parallaction/gui_br.cpp
    engines/parallaction/gui_ns.cpp
    engines/parallaction/input.cpp
    engines/parallaction/objects.cpp
    engines/parallaction/parser.cpp
    engines/parallaction/parser.h
    engines/parallaction/sound_br.cpp
    engines/parallaction/sound_ns.cpp



diff --git a/engines/parallaction/adlib.cpp b/engines/parallaction/adlib.cpp
index 568ad19..a981a55 100644
--- a/engines/parallaction/adlib.cpp
+++ b/engines/parallaction/adlib.cpp
@@ -277,6 +277,15 @@ public:
 			_channels[i].init(this, i);
 
 		_isOpen = false;
+
+		_opl = NULL;
+		memset(_voices, 0, sizeof(_voices));
+
+		_lastVoice = 0;
+		_percussionMask = 0;
+
+		_adlibTimerProc = NULL;
+		_adlibTimerParam = NULL;
 	}
 
 	int open();
diff --git a/engines/parallaction/balloons.cpp b/engines/parallaction/balloons.cpp
index 234abff..c0a516e 100644
--- a/engines/parallaction/balloons.cpp
+++ b/engines/parallaction/balloons.cpp
@@ -55,7 +55,7 @@ protected:
 	}
 
 public:
-	WrappedLineFormatter(Font *font) : _font(font) { }
+	WrappedLineFormatter(Font *font) : _font(font), _lines(0), _lineWidth(0) { }
 	virtual ~WrappedLineFormatter() { }
 
 	virtual void calc(const Common::String &text, uint16 maxwidth) {
@@ -136,7 +136,7 @@ protected:
 	}
 
 public:
-	StringExtent_NS(Font *font) : WrappedLineFormatter(font) { }
+	StringExtent_NS(Font *font) : WrappedLineFormatter(font), _width(0), _height(0) { }
 
 	uint width() const { return _width; }
 	uint height() const { return _height; }
@@ -189,7 +189,8 @@ protected:
 	}
 
 public:
-	StringWriter_NS(Parallaction_ns *vm, Font *font) : WrappedLineFormatter(font), _vm(vm) { }
+	StringWriter_NS(Parallaction_ns *vm, Font *font) : WrappedLineFormatter(font), _vm(vm),
+		_width(0), _height(0), _color(0), _surf(NULL) { }
 
 	void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) {
 		StringExtent_NS	se(_font);
@@ -464,7 +465,7 @@ protected:
 	}
 
 public:
-	StringExtent_BR(Font *font) : WrappedLineFormatter(font) { }
+	StringExtent_BR(Font *font) : WrappedLineFormatter(font), _width(0), _height(0) { }
 
 	uint width() const { return _width; }
 	uint height() const { return _height; }
@@ -480,7 +481,8 @@ class StringWriter_BR : public WrappedLineFormatter {
 	Graphics::Surface	*_surf;
 
 protected:
-	StringWriter_BR(Font *font, byte color) : WrappedLineFormatter(font) {
+	StringWriter_BR(Font *font, byte color) : WrappedLineFormatter(font), _width(0), _height(0),
+			_color(color), _x(0), _y(0), _surf(NULL) {
 
 	}
 
@@ -504,7 +506,8 @@ protected:
 	}
 
 public:
-	StringWriter_BR(Font *font) : WrappedLineFormatter(font) { }
+	StringWriter_BR(Font *font) : WrappedLineFormatter(font), _width(0), _height(0),
+			_color(0), _x(0), _y(0), _surf(NULL) { }
 
 	void write(const Common::String &text, uint maxWidth, byte color, Graphics::Surface *surf) {
 		StringExtent_BR	se(_font);
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index a7087c6..0bf2bab 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -32,6 +32,7 @@ namespace Parallaction {
 Debugger::Debugger(Parallaction *vm)
 	: GUI::Debugger() {
 	_vm = vm;
+	_mouseState = MOUSE_ENABLED_SHOW;
 
 	registerCmd("continue",	WRAP_METHOD(Debugger, cmdExit));
 	registerCmd("location",	WRAP_METHOD(Debugger, Cmd_Location));
diff --git a/engines/parallaction/dialogue.cpp b/engines/parallaction/dialogue.cpp
index 62e2152..771715b 100644
--- a/engines/parallaction/dialogue.cpp
+++ b/engines/parallaction/dialogue.cpp
@@ -140,6 +140,19 @@ DialogueManager::DialogueManager(Parallaction *vm, ZonePtr z) : _vm(vm), _z(z) {
 
 	_cmdList = 0;
 	_answerId = 0;
+
+	_faceId = 0;
+
+	_q = NULL;
+	memset(_visAnswers, 0, sizeof(_visAnswers));
+	_numVisAnswers = 0;
+
+	_selection = _oldSelection = 0;
+
+	_isKeyDown = false;
+	_downKey = 0;
+
+	_mouseButtons = 0;
 }
 
 void DialogueManager::start() {
@@ -412,7 +425,8 @@ protected:
 	}
 
 public:
-	DialogueManager_ns(Parallaction_ns *vm, ZonePtr z) : DialogueManager(vm, z), _vm(vm) {
+	DialogueManager_ns(Parallaction_ns *vm, ZonePtr z) : DialogueManager(vm, z), _vm(vm),
+		_passwordChanged(false), _askPassword(false) {
 		_ballonPos._questionBalloon = Common::Point(140, 10);
 		_ballonPos._questionChar = Common::Point(190, 80);
 		_ballonPos._answerChar = Common::Point(10, 80);
diff --git a/engines/parallaction/disk_br.cpp b/engines/parallaction/disk_br.cpp
index 7458065..af2d2b8 100644
--- a/engines/parallaction/disk_br.cpp
+++ b/engines/parallaction/disk_br.cpp
@@ -762,14 +762,11 @@ Common::String AmigaDisk_br::selectArchive(const Common::String& name) {
 }
 
 
-Disk_br::Disk_br(Parallaction *vm) : _vm(vm), _baseDir(0) {
-
+Disk_br::Disk_br(Parallaction *vm) : _vm(vm), _baseDir(0), _language(0) {
 }
 
 Disk_br::~Disk_br() {
 	_sset.clear();
 }
 
-
-
 } // namespace Parallaction
diff --git a/engines/parallaction/disk_ns.cpp b/engines/parallaction/disk_ns.cpp
index 28e61b0..c25236a 100644
--- a/engines/parallaction/disk_ns.cpp
+++ b/engines/parallaction/disk_ns.cpp
@@ -238,7 +238,7 @@ void Disk_ns::setLanguage(uint16 language) {
 #pragma mark -
 
 
-DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm) {
+DosDisk_ns::DosDisk_ns(Parallaction* vm) : Disk_ns(vm), _gfx(NULL) {
 
 }
 
diff --git a/engines/parallaction/exec.cpp b/engines/parallaction/exec.cpp
index ceba072..3d4e9bd 100644
--- a/engines/parallaction/exec.cpp
+++ b/engines/parallaction/exec.cpp
@@ -81,7 +81,7 @@ void ProgramExec::runScripts(ProgramList::iterator first, ProgramList::iterator
 	return;
 }
 
-ProgramExec::ProgramExec() : _modCounter(0) {
+ProgramExec::ProgramExec() : _modCounter(0), _instructionNames(NULL) {
 }
 
 
diff --git a/engines/parallaction/font.cpp b/engines/parallaction/font.cpp
index 57b04de..f1c3b89 100644
--- a/engines/parallaction/font.cpp
+++ b/engines/parallaction/font.cpp
@@ -302,7 +302,7 @@ protected:
 	}
 
 public:
-	DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width) {
+	DosFont(Cnv *cnv) : _data(cnv), _pitch(cnv->_width), _cp(NULL), _bufPitch(0) {
 	}
 
 	~DosFont() {
diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp
index f1499f7..819804b 100644
--- a/engines/parallaction/gfxbase.cpp
+++ b/engines/parallaction/gfxbase.cpp
@@ -32,7 +32,8 @@ namespace Parallaction {
 
 GfxObj::GfxObj(uint objType, Frames *frames, const char* name) :
 	_frames(frames), x(0), y(0), z(0), _prog(0), _flags(0),
-	type(objType), frame(0), layer(3), scale(100), _hasMask(false), _hasPath(false)  {
+	type(objType), frame(0), layer(3), scale(100), _hasMask(false), _hasPath(false),
+	transparentKey(0), _maskId(0), _pathId(0) {
 
 	if (name) {
 		_name = strdup(name);
diff --git a/engines/parallaction/graphics.cpp b/engines/parallaction/graphics.cpp
index 06b3150..162671b 100644
--- a/engines/parallaction/graphics.cpp
+++ b/engines/parallaction/graphics.cpp
@@ -743,6 +743,8 @@ Gfx::Gfx(Parallaction* vm) :
 	_nextProjectorPos = 0;
 	_hbCircleRadius = 0;
 
+	_overlayMode = false;
+
 	_unpackedBitmap = new byte[MAXIMUM_UNPACKED_BITMAP_SIZE];
 	assert(_unpackedBitmap);
 
diff --git a/engines/parallaction/graphics.h b/engines/parallaction/graphics.h
index 55e2bbc..03b4dd9 100644
--- a/engines/parallaction/graphics.h
+++ b/engines/parallaction/graphics.h
@@ -57,7 +57,7 @@ protected:
 
 
 public:
-	Font() {}
+	Font() : _color(0) {}
 	virtual ~Font() {}
 
 	virtual void setColor(byte color) {
diff --git a/engines/parallaction/gui_br.cpp b/engines/parallaction/gui_br.cpp
index ae3d136..17d759d 100644
--- a/engines/parallaction/gui_br.cpp
+++ b/engines/parallaction/gui_br.cpp
@@ -43,7 +43,8 @@ protected:
 	int _fadeSteps;
 
 public:
-	SplashInputState_BR(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm)  {
+	SplashInputState_BR(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm),
+			_timeOut(0), _startTime(0), _fadeSteps(0) {
 	}
 
 	virtual MenuInputState* run() {
@@ -382,6 +383,9 @@ public:
 		_menuObj->getRect(0, _menuRect);
 		_cellW = _menuRect.width() / 3;
 		_cellH = _menuRect.height() / 2;
+
+		_menuObjId = _mscMenuObjId = _sfxMenuObjId = 0;
+		_sfxStatus = _mscStatus = 0;
 	}
 
 	~IngameMenuInputState_BR() {
diff --git a/engines/parallaction/gui_ns.cpp b/engines/parallaction/gui_ns.cpp
index 3d977c9..3c312c4 100644
--- a/engines/parallaction/gui_ns.cpp
+++ b/engines/parallaction/gui_ns.cpp
@@ -43,7 +43,8 @@ protected:
 	Parallaction *_vm;
 
 public:
-	SplashInputState_NS(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm)  {
+	SplashInputState_NS(Parallaction *vm, const Common::String &name, MenuInputHelper *helper) : MenuInputState(name, helper), _vm(vm),
+			_timeOut(0), _startTime(0) {
 	}
 
 	virtual MenuInputState* run() {
@@ -298,7 +299,7 @@ class LoadGameInputState_NS : public MenuInputState {
 	Parallaction *_vm;
 
 public:
-	LoadGameInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("loadgame", helper), _vm(vm) { }
+	LoadGameInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("loadgame", helper), _vm(vm), _result(false) { }
 
 	virtual MenuInputState* run() {
 		if (!_result) {
@@ -477,6 +478,11 @@ public:
 		_labels[0] = 0;
 		_labels[1] = 0;
 
+		_fail = false;
+		_len = 0;
+		_startTime = 0;
+		_state = 0;
+
 		_codeSelectBlocks[0] = Common::Rect( 111, 129, 127, 153 );	// na
 		_codeSelectBlocks[1] = Common::Rect( 128, 120, 144, 144 );	// wa
 		_codeSelectBlocks[2] = Common::Rect( 145, 111, 161, 135 );	// ra
@@ -689,6 +695,9 @@ public:
 	ShowCreditsInputState_NS(Parallaction *vm, MenuInputHelper *helper) : MenuInputState("showcredits", helper), _vm(vm) {
 		_labels[0] = 0;
 		_labels[1] = 0;
+
+		_current = 0;
+		_startTime = 0;
 	}
 
 	~ShowCreditsInputState_NS() {
@@ -827,6 +836,8 @@ public:
 		_labels[1] = 0;
 		_labels[2] = 0;
 		_labels[3] = 0;
+
+		_allPartsComplete = false;
 	}
 
 	void destroyLabels() {
diff --git a/engines/parallaction/input.cpp b/engines/parallaction/input.cpp
index 290af33..2cd85d7 100644
--- a/engines/parallaction/input.cpp
+++ b/engines/parallaction/input.cpp
@@ -70,6 +70,9 @@ Input::Input(Parallaction *vm) : _vm(vm) {
 	_mouseButtons = 0;
 	_delayedActionZone.reset();
 
+	_inputMode = 0;
+	_hasKeyPressEvent = false;
+
 	_dinoCursor = 0;
 	_dougCursor = 0;
 	_donnaCursor = 0;
diff --git a/engines/parallaction/objects.cpp b/engines/parallaction/objects.cpp
index 8f895f1..950d62a 100644
--- a/engines/parallaction/objects.cpp
+++ b/engines/parallaction/objects.cpp
@@ -145,6 +145,8 @@ Program::Program() {
 	_locals = new LocalVariable[NUM_LOCALS];
 	_numLocals = 0;
 	_status = kProgramIdle;
+	_ip = 0;
+	_loopStart = 0;
 }
 
 Program::~Program() {
@@ -259,6 +261,8 @@ Answer::Answer() {
 	_noFlags = 0;
 	_yesFlags = 0;
 	_hasCounterCondition = false;
+	_counterValue = 0;
+	_counterOp = 0;
 }
 
 bool Answer::textIsNull() {
@@ -298,6 +302,7 @@ Instruction::Instruction() {
 
 	// common
 	_immediate = 0;
+	_endif = 0;
 
 	// BRA specific
 	_text = 0;
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp
index c37cee6..725a8b5 100644
--- a/engines/parallaction/parser.cpp
+++ b/engines/parallaction/parser.cpp
@@ -226,6 +226,7 @@ uint16 Script::readLineToken(bool errorOnEOF) {
 void Parser::reset() {
 	_currentOpcodes = 0;
 	_currentStatements = 0;
+	_lookup = 0;
 
 	_statements.clear();
 	_opcodes.clear();
diff --git a/engines/parallaction/parser.h b/engines/parallaction/parser.h
index 7b77f58..e7ae7dc 100644
--- a/engines/parallaction/parser.h
+++ b/engines/parallaction/parser.h
@@ -405,7 +405,7 @@ protected:
 	virtual void parseRValue(ScriptVar &var, const char *str);
 
 public:
-	ProgramParser_br(Parallaction_br *vm) : ProgramParser_ns((Parallaction_ns*)vm), _vm(vm) {
+	ProgramParser_br(Parallaction_br *vm) : ProgramParser_ns((Parallaction_ns*)vm), _vm(vm), _openIfStatement(0) {
 	}
 
 	virtual void init();
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index d13b318..0147d3c 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -86,7 +86,7 @@ protected:
 	byte *_trackEnd;
 
 public:
-	MidiParser_MSC() : byte_11C5A(false) {
+	MidiParser_MSC() : byte_11C5A(false), _beats(0), _lastEvent(0), _trackEnd(NULL) {
 	}
 };
 
@@ -467,6 +467,11 @@ SoundMan_br::SoundMan_br(Parallaction_br *vm) : _vm(vm) {
 
 	_musicEnabled = true;
 	_sfxEnabled = true;
+
+	_sfxLooping = false;
+	_sfxVolume = 0;
+	_sfxRate = 0;
+	_sfxChannel = 0;
 }
 
 SoundMan_br::~SoundMan_br() {
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index 692389b..6ee58cf 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -323,6 +323,11 @@ void AmigaSoundMan_ns::playLocationMusic(const char *location) {
 
 SoundMan_ns::SoundMan_ns(Parallaction_ns *vm) : _vm(vm) {
 	_mixer = _vm->_mixer;
+	_sfxLooping = false;
+	_sfxVolume = 0;
+	_sfxRate = 0;
+	_sfxChannel = 0;
+	_musicType = 0;
 }
 
 void SoundMan_ns::setMusicVolume(int value) {


Commit: 506549ae45e09b9c4c0c9c786077c429533ce53c
    https://github.com/scummvm/scummvm/commit/506549ae45e09b9c4c0c9c786077c429533ce53c
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-05-28T15:26:31+02:00

Commit Message:
PARALLACTION: Safer string manipulation

Changed paths:
    engines/parallaction/parallaction_ns.cpp
    engines/parallaction/saveload.cpp
    engines/parallaction/sound_ns.cpp



diff --git a/engines/parallaction/parallaction_ns.cpp b/engines/parallaction/parallaction_ns.cpp
index 144c2b3..5fd6d87 100644
--- a/engines/parallaction/parallaction_ns.cpp
+++ b/engines/parallaction/parallaction_ns.cpp
@@ -395,7 +395,7 @@ void Parallaction_ns::changeLocation() {
 		changeCharacter(locname.character());
 	}
 
-	strcpy(g_saveData1, locname.location());
+	Common::strlcpy(g_saveData1, locname.location(), 30);
 	parseLocation(g_saveData1);
 
 	if (_location._startPosition.x != -1000) {
diff --git a/engines/parallaction/saveload.cpp b/engines/parallaction/saveload.cpp
index eff088d..0f4ceae 100644
--- a/engines/parallaction/saveload.cpp
+++ b/engines/parallaction/saveload.cpp
@@ -93,7 +93,7 @@ void SaveLoad_ns::doLoadGame(uint16 slot) {
 	uint16 _si;
 	for (_si = 0; _si < _vm->_numLocations; _si++) {
 		s = f->readLine();
-		strcpy(_vm->_locationNames[_si], s.c_str());
+		Common::strlcpy(_vm->_locationNames[_si], s.c_str(), 32);
 
 		s = f->readLine();
 		_vm->_localFlags[_si] = atoi(s.c_str());
diff --git a/engines/parallaction/sound_ns.cpp b/engines/parallaction/sound_ns.cpp
index 6ee58cf..6073f82 100644
--- a/engines/parallaction/sound_ns.cpp
+++ b/engines/parallaction/sound_ns.cpp
@@ -335,7 +335,7 @@ void SoundMan_ns::setMusicVolume(int value) {
 }
 
 void SoundMan_ns::setMusicFile(const char *filename) {
-	strcpy(_musicFile, filename);
+	Common::strlcpy(_musicFile, filename, PATH_LEN);
 }
 
 void SoundMan_ns::execute(int command, const char *parm = 0) {






More information about the Scummvm-git-logs mailing list