OSDN Git Service

fix crash in QImage conversion benchmark
authorIvailo Monev <xakepa10@gmail.com>
Mon, 4 Jan 2021 00:01:58 +0000 (02:01 +0200)
committerIvailo Monev <xakepa10@gmail.com>
Mon, 4 Jan 2021 00:01:58 +0000 (02:01 +0200)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp

index eb0fc0f..b78e34a 100644 (file)
@@ -86,7 +86,7 @@ void tst_QImageConversion::convertRgb16ToRGB32()
 QImage tst_QImageConversion::generateImage(int width, int height)
 {
     QImage image(width, height, QImage::Format_RGB16);
-    const int byteWidth = width * 3;
+    const int byteWidth = width * 2;
 
     for (int y = 0; y < image.height(); ++y) {
         uchar *scanline = image.scanLine(y);