diff options
author | Peter Wu <peter@lekensteyn.nl> | 2017-01-06 23:17:19 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-01-08 02:48:41 +0000 |
commit | 6e29d874f8b5e6ebc59f661a0bb0dab8e56f122a (patch) | |
tree | 3b39aa2cce626a3043661defd98e07f82363a635 | |
parent | 082ba063efd2a7faf6bd25d73b08197708e117b8 (diff) | |
download | wireshark-6e29d874f8b5e6ebc59f661a0bb0dab8e56f122a.tar.gz wireshark-6e29d874f8b5e6ebc59f661a0bb0dab8e56f122a.tar.bz2 wireshark-6e29d874f8b5e6ebc59f661a0bb0dab8e56f122a.zip |
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>
-rw-r--r-- | ui/qt/rtp_audio_stream.cpp | 5 | ||||
-rw-r--r-- | ui/qt/rtp_player_dialog.h | 5 |
2 files changed, 9 insertions, 1 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)) { diff --git a/ui/qt/rtp_player_dialog.h b/ui/qt/rtp_player_dialog.h index a96fb5972a..44e2142e87 100644 --- a/ui/qt/rtp_player_dialog.h +++ b/ui/qt/rtp_player_dialog.h @@ -99,7 +99,10 @@ private slots: void resetXAxis(); void setPlayPosition(double secs); - void setPlaybackError(const QString playback_error) { playback_error_ = playback_error; } + void setPlaybackError(const QString playback_error) { + playback_error_ = playback_error; + updateHintLabel(); + } void on_playButton_clicked(); void on_stopButton_clicked(); void on_actionReset_triggered(); |