Skip to content

Commit

Permalink
fix out-of-bounds array access
Browse files Browse the repository at this point in the history
  • Loading branch information
RicardoLuis0 committed Feb 4, 2025
1 parent eb7c99b commit a872097
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/r_data/models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ void RenderModel(FModelRenderer *renderer, float x, float y, float z, FSpriteMod
objectToWorldMatrix.rotate(smf->pitchoffset, 0, 0, 1);
objectToWorldMatrix.rotate(-smf->rolloffset, 1, 0, 0);

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);
Expand Down

0 comments on commit a872097

Please sign in to comment.