diff options
| author | John Hurst <jhurst@cinecert.com> | 2021-11-24 09:16:45 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-24 09:16:45 -0800 |
| commit | f16cc0f8bc74648aa9ed80aeedcd474eed8ca818 (patch) | |
| tree | 2a19ecf495ed3bd600ddd1181c0af25f1974a815 /src | |
| parent | 867e53bc8dcc7af12342b5ea2bde2cc888b94c68 (diff) | |
| parent | 88c9336b53dcb8da8fc78a5a5cda17e0175dd2cb (diff) | |
Merge pull request #104 from msheby/bugfix/chunks-after-data
correctly handle WAVE files that don't end with the "data" chunk
Diffstat (limited to 'src')
| -rwxr-xr-x | src/PCM_Parser.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/PCM_Parser.cpp b/src/PCM_Parser.cpp index b8dea71..9efd388 100755 --- a/src/PCM_Parser.cpp +++ b/src/PCM_Parser.cpp @@ -170,9 +170,9 @@ ASDCP::PCM::WAVParser::h__WAVParser::ReadFrame(FrameBuffer& FB) } ui32_t read_count = 0; - Result_t result = m_FileReader.Read(FB.Data(), m_FrameBufferSize, &read_count); + Result_t result = m_FileReader.Read(FB.Data(), (m_DataLength - m_ReadCount >= m_FrameBufferSize) ? m_FrameBufferSize : m_DataLength - m_ReadCount, &read_count); - if ( result == RESULT_ENDOFFILE ) + if ( result == RESULT_ENDOFFILE || (m_DataLength == m_ReadCount + read_count) ) { m_EOF = true; |
