[Scummvm-git-logs] scummvm master -> 09931ae0aa11aafa8ad6324a92fafd1fbcd678af

dreammaster dreammaster at scummvm.org
Sat Sep 16 20:09:39 CEST 2017


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

Summary:
09931ae0aa TITANIC: Fixed FixedQueue compaction when queue has been emptied


Commit: 09931ae0aa11aafa8ad6324a92fafd1fbcd678af
    https://github.com/scummvm/scummvm/commit/09931ae0aa11aafa8ad6324a92fafd1fbcd678af
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-09-16T14:09:28-04:00

Commit Message:
TITANIC: Fixed FixedQueue compaction when queue has been emptied

Changed paths:
    engines/titanic/support/fixed_queue.h


diff --git a/engines/titanic/support/fixed_queue.h b/engines/titanic/support/fixed_queue.h
index a7ba6ea..dbcbeb6 100644
--- a/engines/titanic/support/fixed_queue.h
+++ b/engines/titanic/support/fixed_queue.h
@@ -80,7 +80,8 @@ public:
 	 */
 	void compact() {
 		if (_data.size() == MAX_SIZE && _topIndex > 0) {
-			Common::copy(&_data[_topIndex], &_data[0] + MAX_SIZE, &_data[0]);
+			if (_topIndex < MAX_SIZE)
+				Common::copy(&_data[_topIndex], &_data[0] + MAX_SIZE, &_data[0]);
 			_data.resize(size());
 			_topIndex = 0;
 		}





More information about the Scummvm-git-logs mailing list