Skip to content

Commit 8e223c1

Browse files
committed
add memory clear
1 parent d1c2391 commit 8e223c1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

WavOverSampling/WavOverSampling.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,23 +472,24 @@ int main()
472472
{
473473
DWORD readSize;
474474
if (i != 0) readWavFile(fileName, mem1, DATA_UNIT_SIZE * (i - 1), DATA_UNIT_SIZE);
475+
else ::SecureZeroMemory(mem1, DATA_UNIT_SIZE);
475476
readSize = readWavFile(fileName, mem2, DATA_UNIT_SIZE * i, DATA_UNIT_SIZE);
476477
if (i != part - 1) readWavFile(fileName, mem3, DATA_UNIT_SIZE * (i + 1), DATA_UNIT_SIZE);
478+
else ::SecureZeroMemory(mem3, DATA_UNIT_SIZE);
477479

478480
struct oversample_info info[8];
479481
info[0].src = (short* )mem2;
480482
info[0].length = DATA_UNIT_SIZE / 4;
481483
info[0].coeff = firCoeff;
482484
info[0].tapNum = TAP_SIZE;
483485
info[0].dest = (int* )memOut;
484-
info[0].option = 0x0001;
486+
info[0].option = 0;
485487

486-
// Sigle thread
487-
info[0].option = 0xffff;
488+
// Single thread
488489
ThreadFunc((LPVOID)&info[0]);
489490

490491
/*
491-
// Multi thread (use code below instead of above 2 lines)
492+
// Multi thread (use code below instead of above)
492493
HANDLE thread[8];
493494
DWORD threadId[8];
494495
for (int i = 0; i < 8; ++i)

0 commit comments

Comments
 (0)