mirror of https://github.com/mgba-emu/mgba.git
DS GX: Fix overflow causing a division crash
This commit is contained in:
parent
510a539a50
commit
ec626d723f
1
CHANGES
1
CHANGES
|
@ -22,6 +22,7 @@ Bugfixes:
|
|||
- DS: Properly close save file on close
|
||||
- DS Video: Fix size of VRAM zeroes buffer
|
||||
- DS GX: Fix depth test scaling
|
||||
- DS GX: Fix overflow causing a division crash
|
||||
Misc:
|
||||
- DS GX: Clean up and unify texture mapping
|
||||
- DS Core: Add symbol loading
|
||||
|
|
|
@ -500,7 +500,7 @@ static void _preparePoly(struct DSGXRenderer* renderer, struct DSGXVertex* verts
|
|||
struct DSGXVertex* v1;
|
||||
|
||||
int32_t v0w = v0->viewCoord[3];
|
||||
if (!v0w) {
|
||||
if (!v0w || v0w == INT32_MIN) {
|
||||
v0w = 1;
|
||||
}
|
||||
|
||||
|
@ -518,7 +518,7 @@ static void _preparePoly(struct DSGXRenderer* renderer, struct DSGXVertex* verts
|
|||
v1 = &verts[poly->poly->vertIds[v]];
|
||||
|
||||
int32_t v1w = v1->viewCoord[3];
|
||||
if (!v1w) {
|
||||
if (!v1w || v1w == INT32_MIN) {
|
||||
v1w = 1;
|
||||
}
|
||||
int32_t v1x = (v1->viewCoord[0] + v1w) * (int64_t) (v1->viewportWidth << 12) / (v1w * 2) + (v1->viewportX << 12);
|
||||
|
@ -577,7 +577,7 @@ static void _preparePoly(struct DSGXRenderer* renderer, struct DSGXVertex* verts
|
|||
v1 = &verts[poly->poly->vertIds[0]];
|
||||
|
||||
int32_t v1w = v1->viewCoord[3];
|
||||
if (!v1w) {
|
||||
if (!v1w || v1w == INT32_MIN) {
|
||||
v1w = 1;
|
||||
}
|
||||
int32_t v1x = (v1->viewCoord[0] + v1w) * (int64_t) (v1->viewportWidth << 12) / (v1w * 2) + (v1->viewportX << 12);
|
||||
|
|
Loading…
Reference in New Issue