Fixed, DECORATE parser, DB2 bug: the parser didn't check stream length while skipping block comments, so unclosed ones caused EndOfStreamException.

This commit is contained in:
MaxED 2015-06-24 07:46:08 +00:00
parent a523f7eb28
commit 97d54d2070

View file

@ -179,6 +179,13 @@ namespace CodeImp.DoomBuilder.ZDoom
char c4, c3 = '\0';
do
{
if(datastream.Position == datastream.Length) //mxd
{
// ZDoom doesn't give even a warning message about this, so we shouldn't report error or fail parsing.
General.ErrorLogger.Add(ErrorType.Warning, "DECORATE warning in '" + sourcename + "', line " + GetCurrentLineNumber() + ". Block comment is not closed");
return true;
}
c4 = c3;
c3 = (char)datareader.ReadByte();
}