From 2753ae991adff8ffe7f55ba3f52a3053d9c196d0 Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Fri, 16 Jun 2023 05:38:34 +0300 Subject: [PATCH] knotify: ImageConverter::variantForImage() optimization Signed-off-by: Ivailo Monev --- knotify/imageconverter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/knotify/imageconverter.cpp b/knotify/imageconverter.cpp index 0f728a0d..b3b184d4 100644 --- a/knotify/imageconverter.cpp +++ b/knotify/imageconverter.cpp @@ -74,8 +74,7 @@ QVariant variantForImage(const QImage &_image) // endianess: // - In big endian the order is A,R,G,B // - In little endian the order is B,G,R,A - QByteArray data; - data.resize(rowStride * image.height()); + QByteArray data(rowStride * image.height(), 0); char* dst = data.data(); for (int y=0; y