summaryrefslogtreecommitdiffstats
path: root/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
diff options
context:
space:
mode:
authorAndrew den Exter <andrew.den-exter@nokia.com>2010-09-22 05:41:34 (GMT)
committerAndrew den Exter <andrew.den-exter@nokia.com>2010-09-22 08:03:38 (GMT)
commit5b7d75a57e0ec8ee78f843ab0eb6485b8e3b4a22 (patch)
tree7a474601e5daa4cc6cfb823c0af870f6bd7eb155 /src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
parent2836c2806e3bdfb6d29d99f74f1b15950fa39e35 (diff)
downloadQt-5b7d75a57e0ec8ee78f843ab0eb6485b8e3b4a22.zip
Qt-5b7d75a57e0ec8ee78f843ab0eb6485b8e3b4a22.tar.gz
Qt-5b7d75a57e0ec8ee78f843ab0eb6485b8e3b4a22.tar.bz2
Verify the audio format before trying to open an audio device.
This was causing a crash on windows because the buffer and period sizes were worked out to 0 with an invalid sample size and dividing one by the other is division by 0. Task-number: QTMOBILITY-438 Reviewed-by: Justin McPherson
Diffstat (limited to 'src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp')
-rw-r--r--src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
index 4e6b2df..a4b28d4 100644
--- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
+++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.cpp
@@ -196,8 +196,9 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
break;
}
}
+ if (!match)
+ failed = true;
}
- if (!match) failed = true;
// check frequency
match = false;
@@ -208,6 +209,8 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
break;
}
}
+ if (!match)
+ failed = true;
}
// check sample size
@@ -219,6 +222,8 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
break;
}
}
+ if (!match)
+ failed = true;
}
// check byte order
@@ -230,6 +235,8 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
break;
}
}
+ if (!match)
+ failed = true;
}
// check sample type
@@ -241,6 +248,8 @@ bool QAudioDeviceInfoInternal::testSettings(const QAudioFormat& format) const
break;
}
}
+ if (!match)
+ failed = true;
}
if(!failed) {