mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-20 19:44:57 +00:00
fix underflow in IndexGenerator::AddFan
fix issue 6282 The Last Story seems to render a fan with two vertices. It is non-sense as it shouldn't do anything, but the code underflows at (u32)numVerts-3
This commit is contained in:
parent
a031351eb2
commit
c7486609fa
1 changed files with 2 additions and 2 deletions
|
@ -142,7 +142,7 @@ template <bool pr> void IndexGenerator::AddFan(u32 numVerts)
|
|||
|
||||
if(pr)
|
||||
{
|
||||
for(; i<=numVerts-3; i+=3)
|
||||
for(; i+3<=numVerts; i+=3)
|
||||
{
|
||||
*Tptr++ = index + i - 1;
|
||||
*Tptr++ = index + i + 0;
|
||||
|
@ -153,7 +153,7 @@ template <bool pr> void IndexGenerator::AddFan(u32 numVerts)
|
|||
numT += 3;
|
||||
}
|
||||
|
||||
for(; i<=numVerts-2; i+=2)
|
||||
for(; i+2<=numVerts; i+=2)
|
||||
{
|
||||
*Tptr++ = index + i - 1;
|
||||
*Tptr++ = index + i + 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue