mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
Added palette size check to prevent crash if palette is corrupted
This commit is contained in:
parent
91080d618a
commit
4d26e1acdc
1 changed files with 6 additions and 1 deletions
|
@ -145,7 +145,12 @@ namespace CodeImp.DoomBuilder.Data
|
|||
if((foundfile != null) && FileExists(foundfile))
|
||||
{
|
||||
MemoryStream stream = LoadFile(foundfile);
|
||||
palette = new Playpal(stream);
|
||||
|
||||
if(stream.Length > 767) {//mxd
|
||||
palette = new Playpal(stream);
|
||||
} else {
|
||||
General.ErrorLogger.Add(ErrorType.Warning, "Warning: invalid palette '"+foundfile+"'");
|
||||
}
|
||||
stream.Dispose();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue