GPU/HW: Fix a possible crash in rectangle expansion

This commit is contained in:
Connor McLaughlin 2020-04-19 14:34:17 +10:00
parent 1757932b3a
commit 6ef3626599

View file

@ -308,8 +308,8 @@ void GPU_HW::LoadVertices()
} }
// we can split the rectangle up into potentially 8 quads // we can split the rectangle up into potentially 8 quads
const u32 required_vertices = 6 * ((rectangle_width + (TEXTURE_PAGE_WIDTH - 1)) / TEXTURE_PAGE_WIDTH) * const u32 required_vertices = 6 * (((rectangle_width + (TEXTURE_PAGE_WIDTH - 1)) / TEXTURE_PAGE_WIDTH) + 1u) *
((rectangle_height + (TEXTURE_PAGE_HEIGHT - 1)) / TEXTURE_PAGE_HEIGHT); (((rectangle_height + (TEXTURE_PAGE_HEIGHT - 1)) / TEXTURE_PAGE_HEIGHT) + 1u);
EnsureVertexBufferSpace(required_vertices); EnsureVertexBufferSpace(required_vertices);
// Split the rectangle into multiple quads if it's greater than 256x256, as the texture page should repeat. // Split the rectangle into multiple quads if it's greater than 256x256, as the texture page should repeat.