From dff555b23a5927339c34547ca3a277832fd93770 Mon Sep 17 00:00:00 2001 From: Tom Poole Date: Mon, 21 Oct 2019 11:54:03 +0100 Subject: [PATCH] WAV: Fixed an issue parsing RF64 headers --- .../juce_audio_formats/codecs/juce_WavAudioFormat.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp index a2459c6db0..ac5a70fc58 100644 --- a/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_WavAudioFormat.cpp @@ -1052,8 +1052,15 @@ public: } else if (chunkType == chunkName ("data")) { - if (! isRF64) // data size is expected to be -1, actual data size is in ds64 chunk + if (isRF64) + { + if (dataLength > 0) + chunkEnd = input->getPosition() + dataLength + (dataLength & 1); + } + else + { dataLength = length; + } dataChunkStart = input->getPosition(); lengthInSamples = (bytesPerFrame > 0) ? (dataLength / bytesPerFrame) : 0;