From 6718a49486b307ad938b707549ac1dfb78504300 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 30 Mar 2022 04:49:29 -0700 Subject: Replace a few asserts with actual checks or ASSUME() --- core/hrtf.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/hrtf.cpp') 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 CreateHrtfStore(uint rate, ushort irSize, auto delays_ = reinterpret_cast(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_); -- cgit v1.2.3