summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTim Blechmann <[email protected]>2025-06-24 08:26:19 +0800
committerTim Blechmann <[email protected]>2025-06-24 20:42:39 +0800
commit83f08b5f51dc451caeac53e7c4d5db79fbcefda4 (patch)
tree877f856ff34e12ac8e382f3197af6a3e496e6865 /src/plugins
parent81ee80a5222bfa560907cf2a25e2bbc89f6ef4e7 (diff)
FFmpeg: AudioRenderer - prevent nullptr access to iodeviceHEADdev
When an error occurs (e.g. a headphone being disconnected), the QIODevice for a QAudioSink is destroyed. Application code needs to keep track of this by either handling stateChanged or by wrapping the QIODevice into a QPointer. Fixes: QTBUG-137973 Pick-to: 6.8 6.9 6.10 Change-Id: Ic86bb1adb75100db26799df0605182e52788d564 Reviewed-by: Anton Kudryavtsev <[email protected]> Reviewed-by: Artem Dyomin <[email protected]> Reviewed-by: Nils Petter Skålerud <[email protected]>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/multimedia/ffmpeg/playbackengine/qffmpegaudiorenderer_p.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegaudiorenderer_p.h b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegaudiorenderer_p.h
index 2eda582dd..8fa2ea7b6 100644
--- a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegaudiorenderer_p.h
+++ b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegaudiorenderer_p.h
@@ -119,7 +119,7 @@ private:
QAudioFormat m_sinkFormat;
BufferedDataWithOffset m_bufferedData;
- QIODevice *m_ioDevice = nullptr;
+ QPointer<QIODevice> m_ioDevice;
bool m_lastFramePushDone = true;