diff --git a/core/hw/pvr/ta_util.cpp b/core/hw/pvr/ta_util.cpp index 3c878918a..d9ed2b4e5 100644 --- a/core/hw/pvr/ta_util.cpp +++ b/core/hw/pvr/ta_util.cpp @@ -199,7 +199,7 @@ void sortPolyParams(std::vector& 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& 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& polys, int first, int end, bool merge, re } } } +