diff --git a/ui/image/image_prepare.cpp b/ui/image/image_prepare.cpp index da8bc33..83900f5 100644 --- a/ui/image/image_prepare.cpp +++ b/ui/image/image_prepare.cpp @@ -1011,6 +1011,10 @@ QImage Round( return std::move(image); } + image = std::move(image).convertToFormat( + QImage::Format_ARGB32_Premultiplied); + Assert(!image.isNull()); + // We need to detach image first (if it is shared), before we // count some offsets using QImage::bytesPerLine etc, because // bytesPerLine may change on detach, this leads to crashes: @@ -1068,10 +1072,6 @@ QImage Round( } Assert(!image.isNull()); - image = std::move(image).convertToFormat( - QImage::Format_ARGB32_Premultiplied); - Assert(!image.isNull()); - const auto masks = CornersMask(radius); return Round(std::move(image), masks, corners, target); }