diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index 75e873648..b7587bd2d 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -564,6 +564,8 @@ static void stripwhite (char *str) static char *igets (void) { + assert(PatchPt != nullptr); + char *line; if (*PatchPt == '\0' || PatchPt >= PatchFile + PatchSize ) @@ -2550,7 +2552,7 @@ static bool DoDehPatch() } PatchPt = strchr (PatchFile, '\n'); - while ((cont = GetLine()) == 1) + while (PatchPt != nullptr && (cont = GetLine()) == 1) { CHECKKEY ("Doom version", dversion) else CHECKKEY ("Patch format", pversion)