- Fixed potential uninitialized access in FMapInfoParser::ParseEndGame().

SVN r4287 (trunk)
This commit is contained in:
Randy Heit 2013-05-26 02:56:25 +00:00
parent ce28c9c991
commit 17c7c32a58

View file

@ -660,7 +660,7 @@ FName FMapInfoParser::ParseEndGame()
} }
} }
FIntermissionDescriptor *desc = new FIntermissionDescriptor; FIntermissionDescriptor *desc = new FIntermissionDescriptor;
FIntermissionAction *action; FIntermissionAction *action = NULL;
switch (newSeq.EndType) switch (newSeq.EndType)
{ {
@ -699,15 +699,23 @@ FName FMapInfoParser::ParseEndGame()
break; break;
} }
action->mBackground = newSeq.PicName; if (action == NULL)
action->mMusic = newSeq.Music; {
action->mMusicLooping = newSeq.MusicLooping; sc.ScriptError("Endgame type was not defined");
desc->mActions.Push(action); return NAME_None; // We won't really get here.
}
else
{
action->mBackground = newSeq.PicName;
action->mMusic = newSeq.Music;
action->mMusicLooping = newSeq.MusicLooping;
desc->mActions.Push(action);
FString seq; FString seq;
seq.Format("@EndSequence_%d_", generated++); seq.Format("@EndSequence_%d_", generated++);
ReplaceIntermission(seq, desc); ReplaceIntermission(seq, desc);
return FName(seq); return FName(seq);
}
} }
//========================================================================== //==========================================================================