Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.6.3, 4.7.0
-
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.