The code copied from Flatty is UB and has been fixed here: https://github.com/treeform/flatty/commit/07f6ba8ab96238e5bd1264cf0cea1d1746abb00c