DS GX: Reject and log polygons that clip to more than 10 vertices

This commit is contained in:
Vicki Pfau 2020-07-19 15:36:34 -07:00
parent 69e289995b
commit 0da019dcc3
2 changed files with 5 additions and 0 deletions

View File

@ -18,6 +18,7 @@ Misc:
- DS GX: Clean up and unify texture mapping
- DS Core: Add symbol loading
- DS Video: Simplify VRAM mapping
- DS GX: Reject and log polygons that clip to more than 10 vertices
0.9.0: (Future)
Features:

View File

@ -335,6 +335,10 @@ static bool _clipPolygon(struct DSGX* gx, struct DSGXPolygon* poly) {
for (plane = 5; plane >= 0; --plane) {
newV = 0;
for (v = 0; v < poly->verts; ++v) {
if (newV >= 10) {
mLOG(DS_GX, ERROR, "Polygon clipping invariant failed");
return false;
}
if (!(offscreenVerts[v] & (1 << plane))) {
outList[newV] = inList[v];
outOffscreenVerts[newV] = offscreenVerts[v];