diff options
author | Chris Robinson <[email protected]> | 2022-03-30 04:49:29 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2022-03-30 05:01:06 -0700 |
commit | 6718a49486b307ad938b707549ac1dfb78504300 (patch) | |
tree | f72ac05b3ff23f4e2f4a5fadd8eb44d4967cb8de /core/hrtf.cpp | |
parent | 9537c771054f6aa9445b1f3ddeb8abb348a2eb83 (diff) |
Replace a few asserts with actual checks or ASSUME()
Diffstat (limited to 'core/hrtf.cpp')
-rw-r--r-- | core/hrtf.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/hrtf.cpp b/core/hrtf.cpp index d94c0569..d4d69815 100644 --- a/core/hrtf.cpp +++ b/core/hrtf.cpp @@ -408,7 +408,8 @@ std::unique_ptr<HrtfStore> CreateHrtfStore(uint rate, ushort irSize, auto delays_ = reinterpret_cast<ubyte2*>(base + offset); offset += sizeof(delays_[0])*irCount; - assert(offset == total); + if(unlikely(offset != total)) + throw std::runtime_error{"HrtfStore allocation size mismatch"}; /* Copy input data to storage. */ std::uninitialized_copy(fields.cbegin(), fields.cend(), field_); |