Skip to content

Commit

Permalink
F1QClean.cpp, modAmplitude.cpp: fix array check
Browse files Browse the repository at this point in the history
  • Loading branch information
WolframRhodium committed Apr 20, 2023
1 parent ad3638d commit ff2d3cf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion F1QClean.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ static void VS_CC f1qlimitCreate(const VSMap* in, VSMap* out, void* userData, VS
}

d.nfrequencies = vsapi->propNumElements(in, "freqs");
if (d.nfrequencies == 0 || d.nfrequencies > 10)
if (d.nfrequencies == -1 || d.nfrequencies > 10)
{
vsapi->setError(out, "F1QLimit: for option 1, at least one and not more than 10 freqs must be specified in the array");
vsapi->freeNode(d.node);
Expand Down
4 changes: 2 additions & 2 deletions modAmplitude.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ static void VS_CC amplitudeCreate(const VSMap *in, VSMap *out, void *userData, V
d.connect4 = temp == 0 ? false : true;
}
temp = vsapi->propNumElements(in,"sh");
if ( temp == 0 || temp > 3)
if (temp == -1 || temp > 3)
{
vsapi->setError(out, "Amp: sh array must specify not more than 3 and at least first of 3 values corresponding to 3 planes");
vsapi->freeNode(d.node[0]);
Expand Down Expand Up @@ -524,7 +524,7 @@ static void VS_CC amplitudeCreate(const VSMap *in, VSMap *out, void *userData, V
}

temp = vsapi->propNumElements(in,"sm");
if (temp == 0 || temp > 3)
if (temp == -1 || temp > 3)
{
vsapi->setError(out, "Amp: sm array must specify not more than 3 and at least first of 3 values corresponding to 3 planes");
vsapi->freeNode(d.node[0]);
Expand Down

0 comments on commit ff2d3cf

Please sign in to comment.