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:
parent
17dc5f7a92
commit
051f49c52e
1 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue