forked from osmocom/wireshark
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>
This commit is contained in:
parent
082ba063ef
commit
6e29d874f8
|
@ -549,6 +549,11 @@ void RtpAudioStream::startPlaying()
|
||||||
{
|
{
|
||||||
if (audio_output_) return;
|
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();
|
QAudioDeviceInfo cur_out_device = QAudioDeviceInfo::defaultOutputDevice();
|
||||||
QString cur_out_name = parent()->property("currentOutputDeviceName").toString();
|
QString cur_out_name = parent()->property("currentOutputDeviceName").toString();
|
||||||
foreach (QAudioDeviceInfo out_device, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
|
foreach (QAudioDeviceInfo out_device, QAudioDeviceInfo::availableDevices(QAudio::AudioOutput)) {
|
||||||
|
|
|
@ -99,7 +99,10 @@ private slots:
|
||||||
void resetXAxis();
|
void resetXAxis();
|
||||||
|
|
||||||
void setPlayPosition(double secs);
|
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_playButton_clicked();
|
||||||
void on_stopButton_clicked();
|
void on_stopButton_clicked();
|
||||||
void on_actionReset_triggered();
|
void on_actionReset_triggered();
|
||||||
|
|
Loading…
Reference in New Issue