diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-12-23 21:18:21 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-12-23 21:18:21 +0000 |
| commit | debf377abe77a8d3ac0880932d36c048138d9b3f (patch) | |
| tree | 70a57ca3b06b690cd9ac0f1ebebca8587606bab9 /src | |
| parent | 3526252ff2fd80a459c72ab1c55ea5a6ee61aa2f (diff) | |
Fix unlikely double-free.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/resampler.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/resampler.cc b/src/lib/resampler.cc index 553180f08..322c00c13 100644 --- a/src/lib/resampler.cc +++ b/src/lib/resampler.cc @@ -53,13 +53,17 @@ Resampler::Resampler (int in, int out, int channels) Resampler::~Resampler () { - src_delete (_src); + if (_src) { + src_delete (_src); + } } void Resampler::set_fast () { src_delete (_src); + _src = 0; + int error; _src = src_new (SRC_LINEAR, _channels, &error); if (!_src) { |
