projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3526252
)
Fix unlikely double-free.
author
Carl Hetherington
<cth@carlh.net>
Sun, 23 Dec 2018 21:18:21 +0000
(21:18 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Sun, 23 Dec 2018 21:18:21 +0000
(21:18 +0000)
src/lib/resampler.cc
patch
|
blob
|
history
diff --git
a/src/lib/resampler.cc
b/src/lib/resampler.cc
index 553180f0832c7a26852b2354bec045b1263faa01..322c00c136779f009ad1163119bce5496a191dad 100644
(file)
--- 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) {