Resize Messages vector before storing messages into it in FRED. #1123

Merged
merged 1 commit into from Jan 1, 2017

Conversation

Projects
None yet
2 participants
@MageKing17
Member

MageKing17 commented Jan 1, 2017

Not resizing the Messages vector here was leading to a debug error about an out-of-range vector subscript, and who knows what other problems were being caused by overwriting whatever memory was after the Messages vector. There's no equivalent problem when parsing, because as each message is parsed, it gets pushed onto the back of the vector instead of assigned directly to an index.

This fixes at least one issue raised by Mantis #3006.

Resize Messages vector before storing messages into it in FRED.
Not resizing the Messages vector here was leading to a debug error about an out-of-range vector subscript, and who knows what other problems were being caused by overwriting whatever memory was after the Messages vector. There's no equivalent problem when parsing, because as each message is parsed, it gets pushed onto the back of the vector instead of assigned directly to an index.
@The-E

The-E approved these changes Jan 1, 2017

@The-E The-E merged commit 988c61f into scp-fs2open:master Jan 1, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@MageKing17 MageKing17 deleted the MageKing17:bugfix/fred-messages-vector branch Jan 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment