mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-22 01:34:21 +00:00
Added a check in WindowsMediaAudioFormat to handle reading beyond the end of a file
This commit is contained in:
parent
c1be347a3d
commit
0f2c1f74c8
1 changed files with 4 additions and 1 deletions
|
|
@ -166,6 +166,9 @@ public:
|
|||
|
||||
checkCoInitialiseCalled();
|
||||
|
||||
clearSamplesBeyondAvailableLength (destSamples, numDestChannels, startOffsetInDestBuffer,
|
||||
startSampleInFile, numSamples, lengthInSamples);
|
||||
|
||||
const int stride = numChannels * sizeof (int16);
|
||||
|
||||
while (numSamples > 0)
|
||||
|
|
@ -297,7 +300,7 @@ private:
|
|||
|
||||
sampleRate = inputFormat->nSamplesPerSec;
|
||||
numChannels = inputFormat->nChannels;
|
||||
bitsPerSample = inputFormat->wBitsPerSample;
|
||||
bitsPerSample = inputFormat->wBitsPerSample != 0 ? inputFormat->wBitsPerSample : 16;
|
||||
lengthInSamples = (lengthInNanoseconds * (int) sampleRate) / 10000000;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue