From b676f2f8b6a74e207c6f818cd26a50a6fdb0e4ec Mon Sep 17 00:00:00 2001 From: Thomas Wilshaw Date: Fri, 9 Oct 2020 23:07:25 +0100 Subject: [PATCH] Fix #1252 Checks if the SampleBuffer is valid before trying to extract its packed data. If it is not valid Olive writes blank segments instead. --- app/render/audioplaybackcache.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/render/audioplaybackcache.cpp b/app/render/audioplaybackcache.cpp index 2e3630a7c..f2fc961a8 100644 --- a/app/render/audioplaybackcache.cpp +++ b/app/render/audioplaybackcache.cpp @@ -75,8 +75,11 @@ void AudioPlaybackCache::WritePCM(const TimeRange &range, SampleBufferPtr sample segment_length_ += seg_sz; } - // Convert to packed data, which is what we store on disk - QByteArray a = samples->toPackedData(); + QByteArray a; + if (samples) { + // Convert to packed data, which is what we store on disk + a = samples->toPackedData(); + } // Keep track of validated ranges so we can signal them all at once at the end TimeRangeList ranges_we_validated;