diff --git a/source/SoundStretch/WavFile.cpp b/source/SoundStretch/WavFile.cpp index 3421bca..9d90b8a 100644 --- a/source/SoundStretch/WavFile.cpp +++ b/source/SoundStretch/WavFile.cpp @@ -522,7 +522,7 @@ int WavInFile::readHeaderBlock() nDump = nLen - ((int)sizeof(header.format) - 8); // verify that header length isn't smaller than expected structure - if (nDump < 0) return -1; + if ((nLen < 0) || (nDump < 0)) return -1; header.format.format_len = nLen; @@ -567,7 +567,7 @@ int WavInFile::readHeaderBlock() nDump = nLen - ((int)sizeof(header.fact) - 8); // verify that fact length isn't smaller than expected structure - if (nDump < 0) return -1; + if ((nLen < 0) || (nDump < 0)) return -1; header.fact.fact_len = nLen;