mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Clear g_dc each frame
I was running into a memcpy of overlapping memory regions in R_RenderMaskedSegRange. - This is because of the reallocation of lightlists, which uses Z_Frame_Alloc. - The memory pool that Z_Frame_Alloc draws from is cleared each frame. - g_dc was not cleared though, so when the lightlists were reallocated, it'd try to copy from invalidated pointers. - Access to invalid pointers within the memory pool does not cause a segfault directly (because the memory pool is allocated once). However, a memcpy involving such an invalid pointer leads to overlap, which may cause memory corruption.
This commit is contained in:
parent
924d46d102
commit
93ff380730
1 changed files with 1 additions and 0 deletions
|
|
@ -856,6 +856,7 @@ void D_SRB2Loop(void)
|
|||
precise_t enterprecise = I_GetPreciseTime();
|
||||
precise_t finishprecise = enterprecise;
|
||||
|
||||
g_dc = {};
|
||||
Z_Frame_Reset();
|
||||
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue