QImage::create fail if given an empty size
Previously valid but empty sizes i.e. QSize(0, 131073) where accepted, but such sizes make no sense for an image since they actually contain no pixels Change-Id: Ie61e33401ad8aaea633646c66fc03f36793e839c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>bb10
parent
a21f3431b8
commit
9682d217e2
|
|
@ -117,7 +117,7 @@ QImageData::QImageData()
|
|||
*/
|
||||
QImageData * QImageData::create(const QSize &size, QImage::Format format)
|
||||
{
|
||||
if (!size.isValid() || format == QImage::Format_Invalid)
|
||||
if (size.isEmpty() || format == QImage::Format_Invalid)
|
||||
return nullptr; // invalid parameter(s)
|
||||
|
||||
int width = size.width();
|
||||
|
|
|
|||
Loading…
Reference in New Issue