diff --git a/CHANGELOG.md b/CHANGELOG.md index 52fcf72..67e6c5c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## bliss 0.2.6 +* Fixed an allocation bug in Song::decode that potentially caused segfaults. + ## bliss 0.2.5 * Updates to docs diff --git a/Cargo.lock b/Cargo.lock index a10dc94..9b40667 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,7 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "bliss-audio" -version = "0.2.5" +version = "0.2.6" dependencies = [ "bliss-audio-aubio-rs", "crossbeam", diff --git a/Cargo.toml b/Cargo.toml index b73c9de..0f10b79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bliss-audio" -version = "0.2.5" +version = "0.2.6" authors = ["Polochon-street "] edition = "2018" license = "GPL-3.0-only" diff --git a/src/song.rs b/src/song.rs index 4442981..f7587f3 100644 --- a/src/song.rs +++ b/src/song.rs @@ -510,6 +510,7 @@ fn resample_frame( ) -> Result, BlissError> { let mut resampled = ffmpeg::frame::Audio::empty(); for decoded in rx.iter() { + resampled = ffmpeg::frame::Audio::empty(); resample_context .run(&decoded, &mut resampled) .map_err(|e| { @@ -517,6 +518,8 @@ fn resample_frame( })?; push_to_sample_array(&resampled, &mut sample_array); } + // TODO when ffmpeg-next will be active again: shouldn't we allocate + // `resampled` again? loop { match resample_context.flush(&mut resampled).map_err(|e| { BlissError::DecodingError(format!("while trying to resample song: {:?}", e))