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

UniformValue::fromVariant doesn't handle undefined JS values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P0: Blocker
    • 5.8.0
    • 5.7.1, 5.8.0 RC
    • Qt3D
    • None
    • Ubuntu 16.04
    • 32605e5e25ebcc8de0ca0a8327248e6d28853cd4

    Description

      If an invalid QVariant is passed to UniformValue::fromVariant, Q_UNREACHABLE is reached and the application segfaults without notification. Ideally, the invalid QVariant should have been caught earlier and not passed to the function, but it might be an idea to pass a warning and silently handle this case (setting the value to a zero float) or at least printing a qFatal error message to provide some debug information.

      This may now happen by passing an `undefined` value from QML through QML objects like `Parameter`. While passing `undefined` values from JS is a bad thing, the application shouldn't segfault and crash, but rather print an error that is visible in the application log.

      Attachments

        Activity

          People

            seanharmer Sean Harmer
            dragly Svenn-Arne Dragly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: