mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-11 06:15:05 +00:00
utility: Don't crash on nullptr in free_aligned
This commit is contained in:
parent
56a90db234
commit
c1abe07b0f
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)
|
#elif defined(USE_STD_ALLOC_FREE)
|
||||||
free(mem);
|
free(mem);
|
||||||
#else
|
#else
|
||||||
|
if (mem == nullptr)
|
||||||
|
return;
|
||||||
void* ptr = reinterpret_cast<void*>(*reinterpret_cast<intptr_t*>(static_cast<char*>(mem) - sizeof(void*)));
|
void* ptr = reinterpret_cast<void*>(*reinterpret_cast<intptr_t*>(static_cast<char*>(mem) - sizeof(void*)));
|
||||||
free(ptr);
|
free(ptr);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue