Skip to content

Commit bfa2a3a

Browse files
committed
pullAudioFrame crash
1 parent ae75fc1 commit bfa2a3a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

windows/APIExample/APIExample/Advanced/CustomAudioCapture/CAgoraCaptureAudioDlg.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ void CAgoraCaptureAduioDlg::PullAudioFrameThread(CAgoraCaptureAduioDlg * self)
346346
audioFrame.channels = self->m_renderAudioInfo.channels;
347347
audioFrame.samples = self->m_renderAudioInfo.sampleRate / 100 * self->m_renderAudioInfo.channels;
348348
audioFrame.samplesPerSec = self->m_renderAudioInfo.sampleRate;
349-
audioFrame.buffer = new BYTE[audioFrame.samples * audioFrame.bytesPerSample];
349+
audioFrame.buffer = new BYTE[audioFrame.samples * audioFrame.bytesPerSample * 2];
350350
while (self->m_extenalRenderAudio )
351351
{
352352
nRet = mediaEngine->pullAudioFrame(&audioFrame);
@@ -358,7 +358,7 @@ void CAgoraCaptureAduioDlg::PullAudioFrameThread(CAgoraCaptureAduioDlg * self)
358358
SIZE_T nSize = audioFrame.samples * audioFrame.bytesPerSample;
359359
self->m_audioRender.Render((BYTE*)audioFrame.buffer, nSize);
360360
}
361-
delete audioFrame.buffer;
361+
delete[] audioFrame.buffer;
362362
}
363363

364364

0 commit comments

Comments
 (0)