summaryrefslogtreecommitdiff
path: root/src/PCM_Parser.cpp
diff options
context:
space:
mode:
authorMatthew Sheby <44249925+msheby@users.noreply.github.com>2021-11-23 22:14:44 -0800
committerMatthew Sheby <44249925+msheby@users.noreply.github.com>2021-11-23 22:15:30 -0800
commit88c9336b53dcb8da8fc78a5a5cda17e0175dd2cb (patch)
tree2a19ecf495ed3bd600ddd1181c0af25f1974a815 /src/PCM_Parser.cpp
parent867e53bc8dcc7af12342b5ea2bde2cc888b94c68 (diff)
correctly handle WAVE files that have chunks after the "data" chunk
Diffstat (limited to 'src/PCM_Parser.cpp')
-rwxr-xr-xsrc/PCM_Parser.cpp4
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;