-
Bug
-
Resolution: Done
-
P2: Important
-
4.6.2
-
None
-
Windows
-
bfd87980bdc3d835723f429a3e4dbe2d884bca27
QAudioInputPrivate::read crashes in Windows. The "len" argument is not respected and this causes a access violation. The following code will reproduce the error (parts are missing obviously):
// start the device
QAudioInput *input = new QAudioInput;
QIODevice *inputIO = input->start();
// function after inputIO readyRead is emitted
int bytes = input->bytesReady();
if (bytes > 0) {
QByteArray data;
data.resize(bytes);
inputIO->read(data.data(), bytes);
}
In the QAudioInputPrivate::read function "len" needs to be checked against the total bytes written to the buffer. It currently only checks against the number of bytes read for each iteration of the while loop.
- relates to
-
QTBUG-14549 QIODevice::read returns more than maxSize bytes (audioInput.start())
-
- Closed
-