I have a simple code that decodes the opus frame into sound samples. It runs on Android, but it crashed into a Unity3D iOS project and didn't crash in a regular iOS project.
EXC_BAD_ACCESS (code=1, address=0x2f)
Both projects use the same opus static library and header files.
#include "opus.h" int test1(){ unsigned char opus_chunk[] = {0x68, 0x97, 0x50, 0x0d, 0xba, 0xa4, 0x80, 0x0d, 0x31, 0x21, 0x9c, 0xcf, 0x74, 0x98, 0xda, 0xc6, 0xd5, 0x27, 0xcb, 0xd9, 0x51, 0xd7, 0xce, 0x90, 0xc5, 0x58, 0x94, 0x53, 0xb0, 0xe9, 0xb4, 0xe4, 0xf4, 0x42, 0x4d, 0xc7, 0xa4, 0x61, 0xfa, 0xfe}; int len = sizeof(opus_chunk); short samples[5760]; int err1; OpusDecoder *decoder; decoder = opus_decoder_create(48000, 1, &err1); int n = opus_decode(decoder, opus_chunk, len, samples, 5760, 0); opus_decoder_destroy(decoder); }

Stack trace:
#0 0x00b944ec in compute_allocation ()
I compared the build settings and made them almost the same.
An error sounds: something is wrong with the distribution.
opus_decoder_create may allocate OpusDecoder, but the error is in opus_decode