From: Yoann Lopes Date: Wed, 3 Sep 2014 12:45:50 +0000 (+0200) Subject: Fix integer overflow in several audio plugins. X-Git-Tag: v5.4.0~11^2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18d6560db15d8f65b221717b9a769fd0f00cec35;p=platform%2Fupstream%2Fqtmultimedia.git Fix integer overflow in several audio plugins. Task-number: QTBUG-40804 Change-Id: If006cb7db319bb6fda4ce7eb4f907e897b5d9efa Reviewed-by: Christian Stromme --- diff --git a/src/plugins/alsa/qalsaaudioinput.cpp b/src/plugins/alsa/qalsaaudioinput.cpp index e01f2d7..c66fdb7 100644 --- a/src/plugins/alsa/qalsaaudioinput.cpp +++ b/src/plugins/alsa/qalsaaudioinput.cpp @@ -768,7 +768,7 @@ qint64 QAlsaAudioInput::elapsedUSecs() const if (deviceState == QAudio::StoppedState) return 0; - return clockStamp.elapsed()*1000; + return clockStamp.elapsed() * qint64(1000); } void QAlsaAudioInput::reset() diff --git a/src/plugins/alsa/qalsaaudiooutput.cpp b/src/plugins/alsa/qalsaaudiooutput.cpp index c8d709c..da25a88 100644 --- a/src/plugins/alsa/qalsaaudiooutput.cpp +++ b/src/plugins/alsa/qalsaaudiooutput.cpp @@ -782,7 +782,7 @@ qint64 QAlsaAudioOutput::elapsedUSecs() const if (deviceState == QAudio::StoppedState) return 0; - return clockStamp.elapsed()*1000; + return clockStamp.elapsed() * qint64(1000); } void QAlsaAudioOutput::reset() diff --git a/src/plugins/opensles/qopenslesaudioinput.cpp b/src/plugins/opensles/qopenslesaudioinput.cpp index ac98018..98ddea7 100644 --- a/src/plugins/opensles/qopenslesaudioinput.cpp +++ b/src/plugins/opensles/qopenslesaudioinput.cpp @@ -482,7 +482,7 @@ qint64 QOpenSLESAudioInput::elapsedUSecs() const if (m_deviceState == QAudio::StoppedState) return 0; - return m_clockStamp.elapsed() * 1000; + return m_clockStamp.elapsed() * qint64(1000); } void QOpenSLESAudioInput::setVolume(qreal vol) diff --git a/src/plugins/opensles/qopenslesaudiooutput.cpp b/src/plugins/opensles/qopenslesaudiooutput.cpp index 9c62852..5457aba 100644 --- a/src/plugins/opensles/qopenslesaudiooutput.cpp +++ b/src/plugins/opensles/qopenslesaudiooutput.cpp @@ -290,7 +290,7 @@ qint64 QOpenSLESAudioOutput::elapsedUSecs() const if (m_state == QAudio::StoppedState) return 0; - return m_clockStamp.elapsed() * 1000; + return m_clockStamp.elapsed() * qint64(1000); } void QOpenSLESAudioOutput::reset() diff --git a/src/plugins/pulseaudio/qaudioinput_pulse.cpp b/src/plugins/pulseaudio/qaudioinput_pulse.cpp index 89dc086..b34d754 100644 --- a/src/plugins/pulseaudio/qaudioinput_pulse.cpp +++ b/src/plugins/pulseaudio/qaudioinput_pulse.cpp @@ -692,7 +692,7 @@ qint64 QPulseAudioInput::elapsedUSecs() const if (m_deviceState == QAudio::StoppedState) return 0; - return m_clockStamp.elapsed() * 1000; + return m_clockStamp.elapsed() * qint64(1000); } void QPulseAudioInput::reset() diff --git a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp index 64a0806..b204633 100644 --- a/src/plugins/pulseaudio/qaudiooutput_pulse.cpp +++ b/src/plugins/pulseaudio/qaudiooutput_pulse.cpp @@ -591,7 +591,7 @@ qint64 QPulseAudioOutput::elapsedUSecs() const if (m_deviceState == QAudio::StoppedState) return 0; - return m_clockStamp.elapsed() * 1000; + return m_clockStamp.elapsed() * qint64(1000); } void QPulseAudioOutput::reset() diff --git a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp index eb80645..2c5956b 100644 --- a/src/plugins/qnx-audio/audio/qnxaudioinput.cpp +++ b/src/plugins/qnx-audio/audio/qnxaudioinput.cpp @@ -194,7 +194,7 @@ qint64 QnxAudioInput::elapsedUSecs() const if (m_state == QAudio::StoppedState) return 0; - return m_clockStamp.elapsed() * 1000; + return m_clockStamp.elapsed() * qint64(1000); } QAudio::Error QnxAudioInput::error() const diff --git a/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp b/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp index 4a82e93..c12f3ab 100644 --- a/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp +++ b/src/plugins/qnx-audio/audio/qnxaudiooutput.cpp @@ -180,7 +180,7 @@ qint64 QnxAudioOutput::elapsedUSecs() const if (m_state == QAudio::StoppedState) return 0; else - return m_startTimeStamp.elapsed() * 1000; + return m_startTimeStamp.elapsed() * qint64(1000); } QAudio::Error QnxAudioOutput::error() const diff --git a/src/plugins/windowsaudio/qwindowsaudioinput.cpp b/src/plugins/windowsaudio/qwindowsaudioinput.cpp index 26f0641..e55f3ab 100644 --- a/src/plugins/windowsaudio/qwindowsaudioinput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudioinput.cpp @@ -706,7 +706,7 @@ qint64 QWindowsAudioInput::elapsedUSecs() const if (deviceState == QAudio::StoppedState) return 0; - return timeStampOpened.elapsed()*1000; + return timeStampOpened.elapsed() * qint64(1000); } void QWindowsAudioInput::reset() diff --git a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp index 1c8882e..360441a 100644 --- a/src/plugins/windowsaudio/qwindowsaudiooutput.cpp +++ b/src/plugins/windowsaudio/qwindowsaudiooutput.cpp @@ -682,7 +682,7 @@ qint64 QWindowsAudioOutput::elapsedUSecs() const if (deviceState == QAudio::StoppedState) return 0; - return timeStampOpened.elapsed()*1000; + return timeStampOpened.elapsed() * qint64(1000); } QAudio::Error QWindowsAudioOutput::error() const