When compiling with zig (which enables address/UB sanitizer by default) and playing back my track, I get an error (at runtime) on this line:
|
voice = TSF_NULL, v = f->voices, vEnd = v + f->voiceNum; |
When I start playback of my track, no voices have been created yet, and the f->voices pointer is null.
Doing an offset from a null pointer I guess is a C rules violation. The error is applying zero offset to null pointer. It sounds pretty pedantic to me, but I guess it's still UB according to the spec, and I guess UB can cause the optimizer to do weird stuff.