From 6c62318816afff9f646d4081dc0384f8529a499e Mon Sep 17 00:00:00 2001 From: Daniel Wolf Date: Sun, 10 Feb 2019 20:18:47 +0100 Subject: [PATCH] Clone timeline to prevent modification during iteration Fixes #65 --- CHANGELOG.md | 4 ++++ rhubarb/src/audio/voiceActivityDetection.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91e61e2..17209ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Version history +## Unreleased + +* **Fixed** segmentation fault on OS X ([issue #65](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/65)). + ## Version 1.9.0 * **Added** basic support for non-English recordings through phonetic recognition ([issue #45](https://github.com/DanielSWolf/rhubarb-lip-sync/issues/45)). diff --git a/rhubarb/src/audio/voiceActivityDetection.cpp b/rhubarb/src/audio/voiceActivityDetection.cpp index d6f96f5..cdeb476 100644 --- a/rhubarb/src/audio/voiceActivityDetection.cpp +++ b/rhubarb/src/audio/voiceActivityDetection.cpp @@ -77,7 +77,7 @@ JoiningBoundedTimeline detectVoiceActivity( // Discard very short segments of activity const centiseconds minSegmentLength(5); - for (const auto& segment : activity) { + for (const auto& segment : Timeline(activity)) { if (segment.getDuration() < minSegmentLength) { activity.clear(segment.getTimeRange()); }