Hello,
A user sent us two AIFF files that failed to be read by JUCE's AIFF reader implementation. Why I'm reporting it here is because the same files work correctly in other apps, most notably iTunes (unsurprisingly, it worked in VLC too).
The probleme with each files was:
The "AUTH" chunk was followed by the int 7, followed by "Beatles" and then a null byte. That makes a total of 8 bytes before the next chunk, hence it failed to find the "SSND" chunk, or any other chunks.
I made the following quick and dirty fix, but I'm not really happy with it:
int type = input->readInt();
while ((type & 0xff) == 0 && input->getPosition() < end)
{
type >>= 8;
type |= (int)input->readByte() << 24;
}
If, for some reason, the file is so corrupt that all the following read bytes are null, it reads the whole file, one byte at a time, before failing.
Has anyone a better fix? Can there be a limit to the number of extra null bytes?
Also, in our version of JUCE at least, if the "SSND" chunk isn't found, and if there is a valid sample rate, the reader says "valid" and dataChunkStart isn't initialised.
