diff options
author | Paul Gilbert | 2017-09-18 21:29:29 -0400 |
---|---|---|
committer | Paul Gilbert | 2017-09-18 21:29:29 -0400 |
commit | 4cfbe0291916c99b7e0141bdf4c8c8229a09289f (patch) | |
tree | d2abd68c212b1f225c026e100c973ffb4d37fd4b /engines/titanic/true_talk | |
parent | 0c6b15d8d0e481dfdb71b0b370b40b9ec783781b (diff) | |
download | scummvm-rg350-4cfbe0291916c99b7e0141bdf4c8c8229a09289f.tar.gz scummvm-rg350-4cfbe0291916c99b7e0141bdf4c8c8229a09289f.tar.bz2 scummvm-rg350-4cfbe0291916c99b7e0141bdf4c8c8229a09289f.zip |
TTITANIC: Guard against TTstring items being self-assigned
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r-- | engines/titanic/true_talk/tt_string.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/tt_string.cpp b/engines/titanic/true_talk/tt_string.cpp index 43910fc823..d7e4e86348 100644 --- a/engines/titanic/true_talk/tt_string.cpp +++ b/engines/titanic/true_talk/tt_string.cpp @@ -55,6 +55,10 @@ TTstring::~TTstring() { } void TTstring::operator=(const TTstring &str) { + if (&str == this) + // Trying to assign string to itself + return; + // Delete old string reference, if any if (_data && --_data->_referenceCount == 0) delete _data; |