fix out-of-bounds array access (again)

This commit is contained in:
Ricardo Luís Vaz Silva 2025-02-08 17:55:34 -03:00
parent bfd9b6f720
commit 7eaab2691b

View file

@ -145,7 +145,7 @@ void RenderModel(FModelRenderer *renderer, float x, float y, float z, FSpriteMod
// [MK] distortions might happen depending on when the pixel stretch is compensated for
// so we make the "undistorted" behavior opt-in
if (smf_flags & MDL_CORRECTPIXELSTRETCH)
if ((smf_flags & MDL_CORRECTPIXELSTRETCH) && smf->modelIDs.Size() > 0)
{
stretch = (smf->modelIDs[0] >= 0 ? Models[smf->modelIDs[0]]->getAspectFactor(actor->Level->info->pixelstretch) : 1.f) / actor->Level->info->pixelstretch;
objectToWorldMatrix.scale(1, stretch, 1);