aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/rtp_audio_stream.cpp
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2017-01-06 23:17:19 +0100
committerMichael Mann <mmann78@netscape.net>2017-01-08 02:48:41 +0000
commit6e29d874f8b5e6ebc59f661a0bb0dab8e56f122a (patch)
tree3b39aa2cce626a3043661defd98e07f82363a635 /ui/qt/rtp_audio_stream.cpp
parent082ba063efd2a7faf6bd25d73b08197708e117b8 (diff)
Qt: fix crash on undecodable RTP stream
When the sample rate is zero, a floating point exception (FPE) occurs in QAudioDeviceInfo::nearestFormat. Detect the error condition instead and show an error. Change-Id: Ie2eaa57847938fe15607fa26d0f4e08e7ddd23d1 Fixes: v2.3.0rc0-1664-gd59653f8d5 ("Qt: Make the RTP player output device selectable.") Reviewed-on: https://code.wireshark.org/review/19569 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'ui/qt/rtp_audio_stream.cpp')
-rw-r--r--ui/qt/rtp_audio_stream.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/qt/rtp_audio_stream.cpp b/ui/qt/rtp_audio_stream.cpp
index 34ba58649d..cdd9177ac7 100644
--- a/ui/qt/rtp_audio_stream.cpp
+++ b/ui/qt/rtp_audio_stream.cpp
@@ -549,6 +549,11 @@ void RtpAudioStream::startPlaying()
{
if (audio_output_) return;
+ if (audio_out_rate_ == 0) {
+ emit playbackError(tr("RTP stream is empty or codec is unsupported."));
+ return;
+ }
+
QAudioDeviceInfo cur_out_device = QAudioDeviceInfo::defaultOutputDevice();
QString cur_out_name = parent()->property("currentOutputDeviceName").toString();
foreach (QAudioDeviceInfo out_device, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {