mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-13 07:57:51 +00:00
Fixed crash on loading malformed DeHackEd patches
Lump that contains only "Patch File for DeHackEd v3.0" (without line break at the end) caused a crash
This commit is contained in:
parent
88bebaec39
commit
92f10febe8
1 changed files with 3 additions and 1 deletions
|
@ -564,6 +564,8 @@ static void stripwhite (char *str)
|
||||||
|
|
||||||
static char *igets (void)
|
static char *igets (void)
|
||||||
{
|
{
|
||||||
|
assert(PatchPt != nullptr);
|
||||||
|
|
||||||
char *line;
|
char *line;
|
||||||
|
|
||||||
if (*PatchPt == '\0' || PatchPt >= PatchFile + PatchSize )
|
if (*PatchPt == '\0' || PatchPt >= PatchFile + PatchSize )
|
||||||
|
@ -2550,7 +2552,7 @@ static bool DoDehPatch()
|
||||||
}
|
}
|
||||||
|
|
||||||
PatchPt = strchr (PatchFile, '\n');
|
PatchPt = strchr (PatchFile, '\n');
|
||||||
while ((cont = GetLine()) == 1)
|
while (PatchPt != nullptr && (cont = GetLine()) == 1)
|
||||||
{
|
{
|
||||||
CHECKKEY ("Doom version", dversion)
|
CHECKKEY ("Doom version", dversion)
|
||||||
else CHECKKEY ("Patch format", pversion)
|
else CHECKKEY ("Patch format", pversion)
|
||||||
|
|
Loading…
Reference in a new issue