mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-02-08 04:20:09 +00:00
Fixed a leak in WindowsMediaAudioFormat.
This commit is contained in:
parent
4df0ea72c9
commit
746331a88a
1 changed files with 5 additions and 2 deletions
|
|
@ -193,21 +193,24 @@ public:
|
|||
HRESULT hr = wmSyncReader->GetNextSample (0, &sampleBuffer, &sampleTime,
|
||||
&duration, &flags, &outputNum, &streamNum);
|
||||
|
||||
if (SUCCEEDED (hr))
|
||||
if (sampleBuffer != nullptr)
|
||||
{
|
||||
BYTE* rawData = nullptr;
|
||||
DWORD dataLength = 0;
|
||||
hr = sampleBuffer->GetBufferAndLength (&rawData, &dataLength);
|
||||
jassert (SUCCEEDED (hr));
|
||||
|
||||
bufferStart = 0;
|
||||
bufferEnd = (int) dataLength;
|
||||
|
||||
if (bufferEnd <= 0)
|
||||
{
|
||||
sampleBuffer->Release();
|
||||
return false;
|
||||
}
|
||||
|
||||
buffer.ensureSize (bufferEnd);
|
||||
memcpy (buffer.getData(), rawData, bufferEnd);
|
||||
sampleBuffer->Release();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue