Skip to content

Commit

Permalink
Fix potential crashes when using string to equalizer string
Browse files Browse the repository at this point in the history
  • Loading branch information
james34602 committed Feb 8, 2018
1 parent 6912a4b commit eb33e3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Audio_Engine/eclipse_libjamesdsp_double/jni/ArbFIRGen.c
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ void InitArbitraryEq(ArbitraryEq* eqgain, int *filterLength, int isLinearPhase)
eqgain->freqData = fftw_alloc_complex(eqgain->fLMul2);
eqgain->filterLength = *filterLength;
eqgain->isLinearPhase = isLinearPhase;
eqgain->nodes = 0;
eqgain->nodesCount = 0;
if (!isLinearPhase)
{
Expand Down Expand Up @@ -548,6 +549,8 @@ void ArbitraryEqString2SortedNodes(ArbitraryEq *eqgain, char *frArbitraryEqStrin
{
count++;
double val = strtod(counter, &counter);
if (i == numOfNodes)
break;
if (count % 2)
{
nodes[i]->gain = val;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ void InitArbitraryEq(ArbitraryEq* eqgain, int *filterLength, int isLinearPhase)
eqgain->freqData = fftwf_alloc_complex(eqgain->fLMul2);
eqgain->filterLength = *filterLength;
eqgain->isLinearPhase = isLinearPhase;
eqgain->nodes = 0;
eqgain->nodesCount = 0;
if (!isLinearPhase)
{
Expand Down Expand Up @@ -548,6 +549,8 @@ void ArbitraryEqString2SortedNodes(ArbitraryEq *eqgain, char *frArbitraryEqStrin
{
count++;
float val = strtod(counter, &counter);
if (i == numOfNodes)
break;
if (count % 2)
{
nodes[i]->gain = val;
Expand Down

0 comments on commit eb33e3a

Please sign in to comment.