- Fixed crash calling ChangeSky() with an invalid texture.

This commit is contained in:
drfrag 2021-05-29 20:29:12 +02:00 committed by Rachael Alexanderson
parent acb4d89f52
commit d9db8984af
2 changed files with 2 additions and 4 deletions

View file

@ -80,14 +80,12 @@ void InitSkyMap(FLevelLocals *Level)
Level->skytexture1 = TexMan.GetFrontSkyLayer(Level->skytexture1);
}
skytex1 = TexMan.GetGameTexture(Level->skytexture1, false);
skytex2 = TexMan.GetGameTexture(Level->skytexture2, false);
if (skytex1 == nullptr)
if (skytex1 == nullptr || skytex2 == nullptr)
return;
if ((Level->flags & LEVEL_DOUBLESKY) && skytex1->GetDisplayHeight() != skytex2->GetDisplayHeight())
{
Printf(TEXTCOLOR_BOLD "Both sky textures must be the same height." TEXTCOLOR_NORMAL "\n");

View file

@ -74,7 +74,7 @@ namespace swrenderer
auto sskytex1 = GetPalettedSWTexture(Level->skytexture1, true, false, true);
auto sskytex2 = GetPalettedSWTexture(Level->skytexture2, true, false, true);
if (sskytex1 == nullptr)
if (sskytex1 == nullptr || sskytex2 == nullptr)
return;
skytexturemid = 0;