mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- Don't call M_NotifyNewSave() before closing the new savegame.
- Disallow negative read lengths in FileReader::Read(). SVN r2685 (trunk)
This commit is contained in:
parent
84b9de8c14
commit
61d438e1eb
2 changed files with 4 additions and 2 deletions
|
@ -132,6 +132,8 @@ long FileReader::Seek (long offset, int origin)
|
|||
|
||||
long FileReader::Read (void *buffer, long len)
|
||||
{
|
||||
assert(len >= 0);
|
||||
if (len <= 0) return 0;
|
||||
if (FilePos + len > StartPos + Length)
|
||||
{
|
||||
len = Length - FilePos + StartPos;
|
||||
|
|
|
@ -2060,11 +2060,11 @@ void G_DoSaveGame (bool okForQuicksave, FString filename, const char *descriptio
|
|||
M_AppendPNGChunk (stdfile, MAKE_ID('s','n','X','t'), &next, 1);
|
||||
}
|
||||
|
||||
M_NotifyNewSave (filename.GetChars(), description, okForQuicksave);
|
||||
|
||||
M_FinishPNG (stdfile);
|
||||
fclose (stdfile);
|
||||
|
||||
M_NotifyNewSave (filename.GetChars(), description, okForQuicksave);
|
||||
|
||||
// Check whether the file is ok.
|
||||
bool success = false;
|
||||
stdfile = fopen (filename.GetChars(), "rb");
|
||||
|
|
Loading…
Reference in a new issue