[Scummvm-cvs-logs] scummvm master -> 3e0663a51676f7482a82c4b4afe24e4ee72b7787

sev- sev at scummvm.org
Sun Jun 5 23:10:32 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:
61235e7f55 GUI: Fix possible negative index access
786780ccb9 GUI: Prevent potential negative index access
3e0663a516 AGI: Clean up object initialization


Commit: 61235e7f551f72495d1c0848998fd8698a2a788d
    https://github.com/scummvm/scummvm/commit/61235e7f551f72495d1c0848998fd8698a2a788d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-06-05T23:10:20+02:00

Commit Message:
GUI: Fix possible negative index access

Changed paths:
    gui/ThemeEngine.cpp



diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 90cb612..262b2d7 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -564,7 +564,7 @@ void ThemeEngine::restoreBackground(Common::Rect r) {
 void ThemeEngine::addDrawStep(const Common::String &drawDataId, const Graphics::DrawStep &step) {
 	DrawData id = parseDrawDataId(drawDataId);
 
-	assert(_widgets[id] != 0);
+	assert(id != kDDNone && _widgets[id] != 0);
 	_widgets[id]->_steps.push_back(step);
 }
 


Commit: 786780ccb905277445b5d17d47fdc6669005bfb8
    https://github.com/scummvm/scummvm/commit/786780ccb905277445b5d17d47fdc6669005bfb8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-06-05T23:10:20+02:00

Commit Message:
GUI: Prevent potential negative index access

Changed paths:
    gui/ThemeEngine.cpp



diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp
index 262b2d7..f093846 100644
--- a/gui/ThemeEngine.cpp
+++ b/gui/ThemeEngine.cpp
@@ -865,7 +865,7 @@ void ThemeEngine::queueDD(DrawData type, const Common::Rect &r, uint32 dynamic,
 void ThemeEngine::queueDDText(TextData type, TextColor color, const Common::Rect &r, const Common::String &text, bool restoreBg,
                               bool ellipsis, Graphics::TextAlign alignH, TextAlignVertical alignV, int deltax, const Common::Rect &drawableTextArea) {
 
-	if (_texts[type] == 0)
+	if (type != kTextDataNone && _texts[type] == 0)
 		return;
 
 	Common::Rect area = r;


Commit: 3e0663a51676f7482a82c4b4afe24e4ee72b7787
    https://github.com/scummvm/scummvm/commit/3e0663a51676f7482a82c4b4afe24e4ee72b7787
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-06-05T23:10:20+02:00

Commit Message:
AGI: Clean up object initialization

Changed paths:
    engines/agi/lzw.cpp
    engines/agi/picture.cpp
    engines/agi/preagi_mickey.cpp
    engines/agi/preagi_mickey.h
    engines/agi/sound.cpp
    engines/agi/sound_2gs.h
    engines/agi/sound_sarien.cpp
    engines/agi/text.cpp
    engines/agi/view.h



diff --git a/engines/agi/lzw.cpp b/engines/agi/lzw.cpp
index bf41e1f..ecb6954 100644
--- a/engines/agi/lzw.cpp
+++ b/engines/agi/lzw.cpp
@@ -72,6 +72,7 @@ LZWDecoder::LZWDecoder() {
 	appendCharacter = (uint8 *)malloc(TABLE_SIZE * sizeof(uint8));
 	inputBitCount = 0;  // Number of bits in input bit buffer
 	inputBitBuffer = 0L;
+	BITS = MAX_VALUE = MAX_CODE = 0;
 }
 
 LZWDecoder::~LZWDecoder() {
diff --git a/engines/agi/picture.cpp b/engines/agi/picture.cpp
index a80e811..2b3bba8 100644
--- a/engines/agi/picture.cpp
+++ b/engines/agi/picture.cpp
@@ -44,6 +44,8 @@ PictureMgr::PictureMgr(AgiBase *agi, GfxMgr *gfx) {
 	_minCommand = 0xf0;
 	_flags = 0;
 	_currentStep = 0;
+
+	_width = _height = 0;
 }
 
 void PictureMgr::putVirtPixel(int x, int y) {
diff --git a/engines/agi/preagi_mickey.cpp b/engines/agi/preagi_mickey.cpp
index e1545cd..0584aab 100644
--- a/engines/agi/preagi_mickey.cpp
+++ b/engines/agi/preagi_mickey.cpp
@@ -255,7 +255,7 @@ bool MickeyEngine::checkMenu() {
 	return parse(menu.cmd[iSel0].data[iSel1], menu.arg[iSel0].data[iSel1]);
 }
 
-void MickeyEngine::drawMenu(MSA_MENU menu, int sel0, int sel1) {
+void MickeyEngine::drawMenu(MSA_MENU &menu, int sel0, int sel1) {
 	int iWord;
 	int iRow;
 	int sel;
@@ -286,7 +286,7 @@ void MickeyEngine::drawMenu(MSA_MENU menu, int sel0, int sel1) {
 	_gfx->updateScreen();
 }
 
-void MickeyEngine::getMouseMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow, int x, int y) {
+void MickeyEngine::getMouseMenuSelRow(MSA_MENU &menu, int *sel0, int *sel1, int iRow, int x, int y) {
 	int iWord;
 	int *sel = 0;
 
@@ -313,7 +313,7 @@ void MickeyEngine::getMouseMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int i
 	}
 }
 
-bool MickeyEngine::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) {
+bool MickeyEngine::getMenuSelRow(MSA_MENU &menu, int *sel0, int *sel1, int iRow) {
 	Common::Event event;
 	int *sel = 0;
 	int nWords;
diff --git a/engines/agi/preagi_mickey.h b/engines/agi/preagi_mickey.h
index 81565d3..066880d 100644
--- a/engines/agi/preagi_mickey.h
+++ b/engines/agi/preagi_mickey.h
@@ -710,9 +710,9 @@ protected:
 	void printExeMsg(int);
 	void printDesc(int);
 	bool checkMenu();
-	void drawMenu(MSA_MENU, int, int);
-	void getMouseMenuSelRow(MSA_MENU, int *, int *, int, int, int);
-	bool getMenuSelRow(MSA_MENU, int *, int *, int);
+	void drawMenu(MSA_MENU &, int, int);
+	void getMouseMenuSelRow(MSA_MENU &, int *, int *, int, int, int);
+	bool getMenuSelRow(MSA_MENU &, int *, int *, int);
 	void getMenuSel(char *, int *, int *);
 	void centerMenu(MSA_MENU *);
 	void patchMenu(MSA_MENU *);
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index 8834068..2c1eb02 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -193,6 +193,7 @@ SoundMgr::SoundMgr(AgiBase *agi, Audio::Mixer *pMixer) {
 	_playingSound = -1;
 
 	switch (_vm->_soundemu) {
+	default:
 	case SOUND_EMU_NONE:
 	case SOUND_EMU_AMIGA:
 	case SOUND_EMU_MAC:
diff --git a/engines/agi/sound_2gs.h b/engines/agi/sound_2gs.h
index a7a23f5..49a375c 100644
--- a/engines/agi/sound_2gs.h
+++ b/engines/agi/sound_2gs.h
@@ -126,6 +126,7 @@ public:
 		memset(&osc, 0, sizeof(osc));
 		seg = 0;
 		a = 0;
+		velocity = 0;
 	}
 
 	const IIgsInstrumentHeader *curInstrument; ///< Currently used instrument
diff --git a/engines/agi/sound_sarien.cpp b/engines/agi/sound_sarien.cpp
index 1b3542b..3e44546 100644
--- a/engines/agi/sound_sarien.cpp
+++ b/engines/agi/sound_sarien.cpp
@@ -74,6 +74,7 @@ SoundGenSarien::SoundGenSarien(AgiBase *vm, Audio::Mixer *pMixer) : SoundGen(vm,
 	_useChorus = true;  // FIXME: Currently always true?
 
 	switch (_vm->_soundemu) {
+	default:
 	case SOUND_EMU_NONE:
 		_waveform = waveformRamp;
 		_env = true;
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp
index 274a654..4aa42ff 100644
--- a/engines/agi/text.cpp
+++ b/engines/agi/text.cpp
@@ -39,6 +39,8 @@ TextMgr::TextMgr(AgiEngine *vm, Words *words, GfxMgr *gfx) {
 	_words = words;
 	_gfx = gfx;
 
+	_systemUI = NULL;
+
 	memset(&_messageState, 0, sizeof(_messageState));
 	_textPos.row = 0;
 	_textPos.column = 0;
diff --git a/engines/agi/view.h b/engines/agi/view.h
index e59916d..adcf7dd 100644
--- a/engines/agi/view.h
+++ b/engines/agi/view.h
@@ -132,6 +132,8 @@ struct ScreenObjEntry {
 	uint8 wander_count;
 	// end of motion related variables
 	uint8 loop_flag;
+
+	ScreenObjEntry() { memset(this, 0, sizeof(ScreenObjEntry)); }
 }; // struct vt_entry
 
 } // End of namespace Agi






More information about the Scummvm-git-logs mailing list