1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-20 01:14:20 +00:00

WAV: Fail gracefully on unsupported bit depths

This commit is contained in:
reuk 2020-11-17 16:47:57 +00:00
parent 17dc5f7a92
commit 051f49c52e
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -993,10 +993,12 @@ public:
input->skipNextBytes (2);
bitsPerSample = (unsigned int) (int) input->readShort();
if (bitsPerSample > 64)
if (bitsPerSample > 64 && (int) sampleRate != 0)
{
bytesPerFrame = bytesPerSec / (int) sampleRate;
bitsPerSample = 8 * (unsigned int) bytesPerFrame / numChannels;
if (numChannels != 0)
bitsPerSample = 8 * (unsigned int) bytesPerFrame / numChannels;
}
else
{