Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-8578

QAudioInputPrivate crash in Windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P2: Important P2: Important
    • 4.7.2
    • 4.6.2
    • Multimedia
    • 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.

        1. main.cpp
          0.6 kB
          Jason Hollingsworth
        2. main_high_load.cpp
          0.8 kB
          Lauri W Ahonen
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            denexter Andrew den Exter (closed Nokia identity) (Inactive)
            jhollingsworth Jason Hollingsworth
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes