I'm writing a class that inherits from InputStream so that I can read from custom archive formats. When I try and play a music file from the archive, the program crashes with the message shown in the subject. The source is ThreadFunc in Thread.inl. I know that the file loads successfully, because if I put a breakpoint in read, I can see the audio library moving around in the file. However, it always crashes after a few calls to read.