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

TRIVIAL: QVideoSurfaceFormat method isValid() returns incorrect values (qvideosurfaceformat.cpp)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.7.1
    • 4.6.3, 4.7.0
    • Multimedia
    • None
    • 51cf737151c1c446a9ce77832774202b6bdb4ba2

    Description

      The method "bool QVideoSurfaceFormat::isValid () const" returns incorrect values.

      If you view the code for the method (available here: http://qt.gitorious.org/qt/qt/blobs/4.7/src/multimedia/video/qvideosurfaceformat.cpp#line253 )

      bool QVideoSurfaceFormat::isValid() const
      {
      return d->pixelFormat == QVideoFrame::Format_Invalid && d->frameSize.isValid();
      }

      The function is supposed to return true if the format is VALID; however it states "return d->pixelFormat == QVideoFrame::Format_Invalid", i.e. return true if the format is INVALID!
      The comparision should be != rather than ==.

      Reproduce:
      Create a valid VideoSurfaceFormat instance. Call the isValid() method.
      e.g.

      QSize size(640, 480);
      QVideoSurfaceFormat format(size, QVideoFrame::Format_RGB32);
      format.isValid();

      Expected result:
      True

      Actual result:
      False

      The bug is present in the 4.6.3 MSVC SDK which I am using, and also according to git, it is still in the latest 4.7 branch.

      Attachments

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

        Activity

          People

            poplavsk Dmytro Poplavskiy (Inactive)
            xmt Mark Tolley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes