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

UniformValue::fromVariant doesn't handle undefined JS values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P0: Blocker
    • Resolution: Done
    • Affects Version/s: 5.7.1, 5.8.0 RC
    • Fix Version/s: 5.8.0
    • Component/s: Qt3D
    • Labels:
      None
    • Environment:
      Ubuntu 16.04
    • Commits:
      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

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes