mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-15 00:05:06 +00:00
utility: Don't crash on nullptr in free_aligned
This commit is contained in:
parent
69b925a3c8
commit
b2dd816ff2
1 changed files with 2 additions and 0 deletions
|
@ -224,6 +224,8 @@ void util::free_aligned(void* mem)
|
|||
#elif defined(USE_STD_ALLOC_FREE)
|
||||
free(mem);
|
||||
#else
|
||||
if (mem == nullptr)
|
||||
return;
|
||||
void* ptr = reinterpret_cast<void*>(*reinterpret_cast<intptr_t*>(static_cast<char*>(mem) - sizeof(void*)));
|
||||
free(ptr);
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue