mirror of
https://github.com/libretro/ppsspp.git
synced 2025-02-27 12:05:43 +00:00
don't try to access past the number of vertices when drawing rectangles
This commit is contained in:
parent
682ef7d083
commit
4a150bead7
@ -174,7 +174,7 @@ void IndexGenerator::AddLineStrip(int numVerts) {
|
||||
void IndexGenerator::AddRectangles(int numVerts) {
|
||||
u16 *outInds = inds_;
|
||||
const int startIndex = index_;
|
||||
for (int i = 0; i < numVerts; i += 2) {
|
||||
for (int i = 0; i +1 < numVerts; i += 2) {
|
||||
*outInds++ = startIndex + i;
|
||||
*outInds++ = startIndex + i + 1;
|
||||
}
|
||||
@ -387,7 +387,7 @@ void IndexGenerator::TranslateLineStrip(int numInds, const u16 *_inds, int index
|
||||
void IndexGenerator::TranslateRectangles(int numInds, const u8 *inds, int indexOffset) {
|
||||
indexOffset = index_ - indexOffset;
|
||||
u16 *outInds = inds_;
|
||||
for (int i = 0; i < numInds; i += 2) {
|
||||
for (int i = 0; i + 1 < numInds; i += 2) {
|
||||
*outInds++ = indexOffset + inds[i];
|
||||
*outInds++ = indexOffset + inds[i+1];
|
||||
}
|
||||
|
@ -467,7 +467,7 @@ void SoftwareTransform(
|
||||
u16 *newInds = inds + vertexCount;
|
||||
u16 *indsOut = newInds;
|
||||
maxIndex = 4 * vertexCount;
|
||||
for (int i = 0; i < vertexCount; i += 2) {
|
||||
for (int i = 0; i + 1 < vertexCount; i += 2) {
|
||||
const TransformedVertex &transVtxTL = transformed[indsIn[i + 0]];
|
||||
const TransformedVertex &transVtxBR = transformed[indsIn[i + 1]];
|
||||
|
||||
|
@ -102,7 +102,7 @@ static void ExpandRectangles(std::vector<GPUDebugVertex> &vertices, std::vector<
|
||||
u16 v = 0;
|
||||
GPUDebugVertex *vert = &newVerts[0];
|
||||
u16 *ind = &newInds[0];
|
||||
for (size_t i = 0, end = numInds; i < end; i += 2) {
|
||||
for (size_t i = 0, end = numInds; i+1 < end; i += 2) {
|
||||
const auto &orig_tl = useInds ? vertices[indices[i]] : vertices[i];
|
||||
const auto &orig_br = useInds ? vertices[indices[i + 1]] : vertices[i + 1];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user