summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@jollamobile.com>2012-11-09 14:06:25 +0100
committerAndy Shaw <andy.shaw@digia.com>2012-11-14 11:43:03 +0100
commit728c658ef48fefe48e467b61e00604f789bb268d (patch)
tree4b3be8665c98008528ee592dfb9e79755731cc45
parent880cdf61760a39457a80f86c32c9f66e76b575f9 (diff)
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. (backport of 7b9833ec028a237cb2ad90411e1b2bbe9bd9a866 from qtmultimedia) Change-Id: I1df6d09efa71d28cea6f4317701fe2eee8c8a963 Done-with: Vesa-Matti Hartikainen Reviewed-by: Andy Shaw <andy.shaw@digia.com>
-rw-r--r--src/multimedia/effects/qsoundeffect_pulse_p.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/multimedia/effects/qsoundeffect_pulse_p.cpp b/src/multimedia/effects/qsoundeffect_pulse_p.cpp
index 493c121677..3c5b1e9859 100644
--- a/src/multimedia/effects/qsoundeffect_pulse_p.cpp
+++ b/src/multimedia/effects/qsoundeffect_pulse_p.cpp
@@ -699,7 +699,9 @@ void QSoundEffectPrivate::playSample()
qDebug() << this << "playSample";
#endif
Q_ASSERT(m_pulseStream);
- 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()