diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index 1bd9531e9b0..2f53cba03f0 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -1129,8 +1129,11 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const ++cpp; // limit to 4 characters per pixel // 64^4 colors is enough for a 4096x4096 image - if (cpp > 4) - break; + if (cpp > 4) { + qWarning("Qt does not support writing XPM images with more than " + "64^4 colors (requested: %d colors).", ncolors); + return false; + } } QString line;