mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-09 18:39:45 +01:00
Initialize temporary edentity when loading levels
It is possible for any of the QueryIntAttribute()s to fail, most commonly if the attributes don't exist. If that happens, then that part of the temporary edentity won't be initialized, and we'll end up having a partially-uninitialized edentity - then doing much of anything with it will result in undefined behavior. To fix this, just initialize the temporary edentity.
This commit is contained in:
parent
69b0f0b650
commit
4e52dccdae
1 changed files with 1 additions and 1 deletions
|
@ -1783,7 +1783,7 @@ bool editorclass::load(std::string& _path)
|
||||||
{
|
{
|
||||||
for( tinyxml2::XMLElement* edEntityEl = pElem->FirstChildElement(); edEntityEl; edEntityEl=edEntityEl->NextSiblingElement())
|
for( tinyxml2::XMLElement* edEntityEl = pElem->FirstChildElement(); edEntityEl; edEntityEl=edEntityEl->NextSiblingElement())
|
||||||
{
|
{
|
||||||
edentities entity;
|
edentities entity = edentities();
|
||||||
const char* text = edEntityEl->GetText();
|
const char* text = edEntityEl->GetText();
|
||||||
|
|
||||||
if (text != NULL)
|
if (text != NULL)
|
||||||
|
|
Loading…
Reference in a new issue