mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Fix memory leak
This commit is contained in:
parent
c69a4f9ced
commit
1bf1da749e
1 changed files with 8 additions and 0 deletions
|
|
@ -410,10 +410,18 @@ UINT8 *R_GenerateTexture(size_t texnum)
|
|||
x2 = x1 + width;
|
||||
|
||||
if (x1 > texture->width || x2 < 0)
|
||||
{
|
||||
if (dealloc)
|
||||
Z_Free(realpatch);
|
||||
continue; // patch not located within texture's x bounds, ignore
|
||||
}
|
||||
|
||||
if (patch->originy > texture->height || (patch->originy + height) < 0)
|
||||
{
|
||||
if (dealloc)
|
||||
Z_Free(realpatch);
|
||||
continue; // patch not located within texture's y bounds, ignore
|
||||
}
|
||||
|
||||
// patch is actually inside the texture!
|
||||
// now check if texture is partly off-screen and adjust accordingly
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue