I found the book by accident and it's one of the best books I've ever read. I'm not a very experienced Programmer yet, so please forgive me if the following question is stupid.
The termination criterion for the while-loop in the CSoundResource::ParseWave() function is
if (m_PCMBuffer && m_PCMBufferSize != 0) return true;
This only checks if the data-block has been read. Since it is mentioned in the comment before the while loop, that the fmt-block can be placed behind the data block in the .wav-file, I think it is not enough. One could initialize m_WavFormatEx to zero before the while loop
memset(&m_WavFormatEx, 0, sizeof(WAVEFORMATEX));
and add it to the check
if ((m_PCMBuffer && m_PCMBufferSize != 0 && m_WavFormatEx) return true;
I'm not sure if this is necessary so I'm looking forward to any answer.
Tanks alot.
The termination criterion for the while-loop in the CSoundResource::ParseWave() function is
if (m_PCMBuffer && m_PCMBufferSize != 0) return true;
This only checks if the data-block has been read. Since it is mentioned in the comment before the while loop, that the fmt-block can be placed behind the data block in the .wav-file, I think it is not enough. One could initialize m_WavFormatEx to zero before the while loop
memset(&m_WavFormatEx, 0, sizeof(WAVEFORMATEX));
and add it to the check
if ((m_PCMBuffer && m_PCMBufferSize != 0 && m_WavFormatEx) return true;
I'm not sure if this is necessary so I'm looking forward to any answer.
Tanks alot.