diff options
author | Robin Burchell <robin.burchell@jollamobile.com> | 2012-11-07 23:23:45 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-09 11:46:04 +0100 |
commit | a73dfa7c63b82e25f93e44ed6386664373aaca74 (patch) | |
tree | d6d61bde5e3cd97dd70a90d4be614adbf8834f7e /src | |
parent | c042e61a77e9bd7a4dfcca0cd68a9f9f3a2cd576 (diff) | |
download | qtmultimedia-a73dfa7c63b82e25f93e44ed6386664373aaca74.tar.gz |
Fix a possible crash in QSoundEffect.
pa_stream_cork may fail, and pa_operation_unref won't handle that gracefully, so
check the return value before unreffing.
Done-with: Vesa-Matti Hartikainen
Change-Id: If789e37a13f85487c79dd8a03a7ca3624b1412d2
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/multimedia/audio/qsoundeffect_pulse_p.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.cpp b/src/multimedia/audio/qsoundeffect_pulse_p.cpp index a1010fa46..3546c86b2 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.cpp +++ b/src/multimedia/audio/qsoundeffect_pulse_p.cpp @@ -838,7 +838,9 @@ void QSoundEffectPrivate::playSample() #endif Q_ASSERT(m_pulseStream); Q_ASSERT(pa_stream_get_state(m_pulseStream) == PA_STREAM_READY); - pa_operation_unref(pa_stream_cork(m_pulseStream, 0, 0, 0)); + pa_operation *o = pa_stream_cork(m_pulseStream, 0, 0, 0); + if (o) + pa_operation_unref(o); } void QSoundEffectPrivate::stop() |