Fix an unlikely memory leak in zita-resampler

This commit is contained in:
Robin Gareus 2022-05-07 04:18:29 +02:00
parent 221975a982
commit f0a8b8cd6d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
1 changed files with 12 additions and 8 deletions

View File

@ -98,7 +98,13 @@ Resampler::setup (unsigned int fs_inp,
}
}
clear ();
if (T) {
if (!T || !B) {
Resampler_table::destroy (T);
delete [] B;
return 1;
}
_table = T;
_buff = B;
_nchan = nchan;
@ -106,8 +112,6 @@ Resampler::setup (unsigned int fs_inp,
_pstep = s;
return reset ();
}
else return 1;
}
void
Resampler::clear (void)