Bug in WavAudioFormat mis-reading cue country, language, etc


#1

I found a bug in
juce_WavAudioFormat.cpp

Lines 1137 through 1140 should be readShort() rather than readInt()


#2

Could you please provide a wav file that demonstrates the issue?


#3
                        else if (adtlChunkType == chunkName ("ltxt"))
                        {
                            const String prefix ("CueRegion" + String (cueRegionIndex++));
                            const uint32 identifier     = (uint32) input->readInt();
                            const uint32 sampleLength   = (uint32) input->readInt();
                            const uint32 purpose        = (uint32) input->readInt();
                            const uint16 country        = (uint16) input->readInt();
                            const uint16 language       = (uint16) input->readInt();
                            const uint16 dialect        = (uint16) input->readInt();
                            const uint16 codePage       = (uint16) input->readInt();
                            const uint32 stringLength   = adtlLength - 20;

#4

From "const uint16 country " down it’s stored and cast as uint16 but still reading an int.

With zero’s in those fields codePage reads 20 and dialect reads 29804.


#5

Test wave file


#6

Thanks. I’ll get a fix pushed out shortly.


#7