pvr: more std::vector::operator[] UB

Issue #1100
This commit is contained in:
Flyinghead 2023-06-05 17:12:15 +02:00
parent f590766421
commit 2644c2ef47
1 changed files with 3 additions and 2 deletions

View File

@ -199,7 +199,7 @@ void sortPolyParams(std::vector<PolyParam>& polys, int first, int end, rend_cont
if (end - first <= 1)
return;
PolyParam * const pp_end = &polys[end];
PolyParam * const pp_end = polys.data() + end;
for (PolyParam *pp = &polys[first]; pp != pp_end; pp++)
{
@ -210,7 +210,7 @@ void sortPolyParams(std::vector<PolyParam>& polys, int first, int end, rend_cont
else
{
Vertex *vtx = &ctx.verts[pp->first];
Vertex *vtx_end = &ctx.verts[pp->first + pp->count];
Vertex *vtx_end = vtx + pp->count;
if (pp->isNaomi2())
{
@ -535,3 +535,4 @@ void makeIndex(std::vector<PolyParam>& polys, int first, int end, bool merge, re
}
}
}