jdryg / vg-renderer

A vector graphics renderer for bgfx, based on ideas from NanoVG and ImDrawList (Dear ImGUI)
BSD 2-Clause "Simplified" License
503 stars 55 forks source link

Add null checks before calls to bx::alignedFree() #32

Closed jfperusse closed 3 months ago

jfperusse commented 3 months ago

Previously, BX_ALIGNED_FREE was going through bx::realloc which includes a null check. However, bx::alignedFree() directly calls into bx::free() which will crash when passed a null pointer. These extra checks prevent crashes introduced after the migration from BX_ALIGNED_FREE to bx::alignedFree.

Fixes https://github.com/jdryg/vg-renderer/issues/31.