mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-10-16 22:37:52 +00:00
video_core: Fix benign out-of-bounds indexing of array (#2553)
The resulting pointer wasn't written to unless the index was verified as valid, but that's still UB and triggered debug checks in MSVC. Reported by garrettboast on IRC
This commit is contained in:
parent
9989daa420
commit
ef90a662f2
1 changed files with 1 additions and 2 deletions
|
@ -39,9 +39,8 @@ OutputVertex OutputVertex::FromAttributeBuffer(const RasterizerRegs& regs, Attri
|
||||||
|
|
||||||
for (unsigned comp = 0; comp < 4; ++comp) {
|
for (unsigned comp = 0; comp < 4; ++comp) {
|
||||||
RasterizerRegs::VSOutputAttributes::Semantic semantic = semantics[comp];
|
RasterizerRegs::VSOutputAttributes::Semantic semantic = semantics[comp];
|
||||||
float24* out = &vertex_slots[semantic];
|
|
||||||
if (semantic < vertex_slots.size()) {
|
if (semantic < vertex_slots.size()) {
|
||||||
*out = input.attr[i][comp];
|
vertex_slots[semantic] = input.attr[i][comp];
|
||||||
} else if (semantic != RasterizerRegs::VSOutputAttributes::INVALID) {
|
} else if (semantic != RasterizerRegs::VSOutputAttributes::INVALID) {
|
||||||
LOG_ERROR(HW_GPU, "Invalid/unknown semantic id: %u", (unsigned int)semantic);
|
LOG_ERROR(HW_GPU, "Invalid/unknown semantic id: %u", (unsigned int)semantic);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue