Fix crash in optimized solid fills on RGBA64PM

Was expecting destStore64 to be non-null.

Change-Id: I4fc827256630a35e0669d405c04f9b5b7e71580e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Allan Sandfeld Jensen 2019-08-14 10:29:21 +02:00
parent b5677bc6da
commit 8bd48a1c33
2 changed files with 14 additions and 1 deletions

View File

@ -4491,7 +4491,7 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)
while (count--) {
int x = spans->x;
int length = spans->len;
if (solidFill && bpp >= QPixelLayout::BPP8 && spans->coverage == 255 && length) {
if (solidFill && bpp >= QPixelLayout::BPP8 && spans->coverage == 255 && length && op.destStore64) {
// If dest doesn't matter we don't need to bother with blending or converting all the identical pixels
op.destStore64(data->rasterBuffer, x, spans->y, &color, 1);
spanfill_from_first(data->rasterBuffer, bpp, x, spans->y, length);

View File

@ -85,6 +85,8 @@ private slots:
void testRasterARGB8565PM();
void testRasterGrayscale8_data();
void testRasterGrayscale8();
void testRasterRGBA64PM_data();
void testRasterRGBA64PM();
#ifndef QT_NO_OPENGL
void testOpenGL_data();
@ -226,6 +228,17 @@ void tst_Lancelot::testRasterGrayscale8()
}
void tst_Lancelot::testRasterRGBA64PM_data()
{
setupTestSuite();
}
void tst_Lancelot::testRasterRGBA64PM()
{
runTestSuite(Raster, QImage::Format_RGBA64_Premultiplied);
}
#ifndef QT_NO_OPENGL
bool tst_Lancelot::checkSystemGLSupport()
{