fix crash with skin format (#5000)

This commit is contained in:
TheKodeToad 2026-02-18 12:51:19 +00:00 committed by GitHub
commit 61d55b4223
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -58,7 +58,7 @@ static QImage improveSkin(QImage skin)
// It seems some older skins may use this format, which can't be drawn onto
// https://github.com/PrismLauncher/PrismLauncher/issues/4032
// https://doc.qt.io/qt-6/qpainter.html#begin
if (skin.format() == QImage::Format_Indexed8) {
if (skin.format() <= QImage::Format_Indexed8 || !skin.hasAlphaChannel()) {
skin = skin.convertToFormat(QImage::Format_ARGB32);
}