Fix spelling + avoid ubsan violation when count/vertices is 0 (#3)

This commit is contained in:
Anonymous Maarten 2025-05-31 02:40:02 +02:00 committed by GitHub
parent bf23f4d0d1
commit 20d4ed7613
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -19,6 +19,9 @@ void Direct3DRMSoftwareRenderer::SetBackbuffer(SDL_Surface* buf)
void Direct3DRMSoftwareRenderer::PushVertices(const PositionColorVertex* vertices, size_t count) void Direct3DRMSoftwareRenderer::PushVertices(const PositionColorVertex* vertices, size_t count)
{ {
if (!count) {
return;
}
m_vertexBuffer.resize(count); m_vertexBuffer.resize(count);
memcpy(m_vertexBuffer.data(), vertices, count * sizeof(PositionColorVertex)); memcpy(m_vertexBuffer.data(), vertices, count * sizeof(PositionColorVertex));
} }
@ -243,7 +246,7 @@ void Direct3DRMSoftwareRenderer::GetDesc(D3DDEVICEDESC* halDesc, D3DDEVICEDESC*
const char* Direct3DRMSoftwareRenderer::GetName() const char* Direct3DRMSoftwareRenderer::GetName()
{ {
return "Software Rendere"; return "Software Renderer";
} }
HRESULT Direct3DRMSoftwareRenderer::Render() HRESULT Direct3DRMSoftwareRenderer::Render()