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

QDeclarativeRadioData can crash in QML app if no radio data available

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.5.1
    • 5.5.0
    • Multimedia
    • None
    • ded4d7b006180d12f4f2e7642877ffc6586a5331

    Description

      I have a QML application which uses Radio element and it's radioData variable for accessing RDS channel name etc.

      In environment without radio hardware, the radioData (in c++ side) is null and accessing it's variables causes the QML program to crash. This could be easily fixed with sanity checks in qdeclarativeradiodata.cpp.

      Top of stack trace:

      #0 QRadioData::stationName (this=0x0) at radio/qradiodata.cpp:300
      #1 0x678b02e9 in QDeclarativeRadioData::stationName (this=0x9636170) at qdeclarativeradiodata.cpp:242
      #2 0x678be082 in QDeclarativeRadioData::qt_metacall (this=0x9636170, _c=QMetaObject::ReadProperty, _id=3,

      This is enough to trigger the bug:

      import QtQuick 2.4
      import QtQuick.Window 2.2
      import QtMultimedia 5.0
      
      Window {
          visible: true
          Radio {
                 id: radio
                 band: Radio.FM
          }
          Text {
              text: radio.radioData.stationName
          }
      }
      

      It must be run in an environment with no radio hardware.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ylopes Yoann Lopes
            vranki Ville Ranki
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes