Skip to content

Commit

Permalink
iirfilt: using proper error handling when filter design fails
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaeddert committed Feb 1, 2025
1 parent abff241 commit 5731b10
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/filter/src/iirfilt.proto.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,8 @@ IIRFILT() IIRFILT(_create_prototype)(liquid_iirdes_filtertype _ftype,
float A[h_len];

// design filter (compute coefficients)
int err = liquid_iirdes(_ftype, _btype, _format, _order, _fc, _f0, _ap, _as, B, A);
if (err != LIQUID_OK)
return NULL;
if (liquid_iirdes(_ftype, _btype, _format, _order, _fc, _f0, _ap, _as, B, A) != LIQUID_OK)
return liquid_error_config("iirfilt_%s_create_prototype(), could not design filter", EXTENSION_FULL);

// move coefficients to type-specific arrays (e.g. float complex)
TC Bc[h_len];
Expand Down

0 comments on commit 5731b10

Please sign in to comment.