Wave files are not valid when adding bwf and ixml

I found this with Nuendo 5.5 and haven’t had a chance to test with 6.5 yet but it is probably still using the same code for writing wave files. I’ll test later tonight.

The problem is manifest when you have a wav file that has an odd number of bytes in the data chunk and you include the bwf metadata in the export dialog. Doing so also appends an iXML chunk to the file. However, it doesn’t seem to check the length of the previous data chunk when doing so. Wav chunks are supposed to be padded when the byte count is odd to align them to an even byte address. It looks like the call that is appending the iXML chunk is failing to account for this and is just tacking it on. When other apps try to read the file they begin reading the iXML chunk 1 byte in (i.e. xml? where ? is the first byte of the ixml chunk size.