diff options
author | Axel Spoerl <[email protected]> | 2025-06-04 16:16:33 +0200 |
---|---|---|
committer | Axel Spoerl <[email protected]> | 2025-06-05 08:48:25 +0200 |
commit | 941882a7443a83a8346674e98b6a5ad711f588ff (patch) | |
tree | 36a626b794d510c2a9c6239b4dc8b20477de6e16 /src/plugins/tts | |
parent | 8ead156d0a8c0df723658b4cfaf246f4e4b2de00 (diff) |
QTextToSpeechProcessorFlite::startTokenTimer() reads the already played
time from m_audioSink. If the first token passed to the processor is
invalid, m_audioSink hasn't been created. The application crashed with
a nullptr access.
Assume that played time is 0, when there is no audiosink.
Add an autotest.
Fixes: QTBUG-128818
Pick-to: 6.10 6.9 6.8
Change-Id: I212a413967fb5b0d3a1190d2ed3f34ac434aeb77
Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'src/plugins/tts')
-rw-r--r-- | src/plugins/tts/flite/qtexttospeech_flite_processor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp b/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp index 99c263e..84979c2 100644 --- a/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp +++ b/src/plugins/tts/flite/qtexttospeech_flite_processor.cpp @@ -37,7 +37,7 @@ void QTextToSpeechProcessorFlite::startTokenTimer() qCDebug(lcSpeechTtsFlite) << "Starting token timer with" << m_tokens.count() - m_currentToken << "left"; const TokenData &token = m_tokens.at(m_currentToken); - const qint64 playedTime = m_audioSink->processedUSecs() / 1000; + const qint64 playedTime = m_audioSink ? m_audioSink->processedUSecs() / 1000 : 0; m_tokenTimer.start(qMax(token.startTime - playedTime, 0), Qt::PreciseTimer, this); } |