diff options
Diffstat (limited to 'src/gui/image/qxpmhandler.cpp')
-rw-r--r-- | src/gui/image/qxpmhandler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp index ce7f7b8a0f..9c54b9ada4 100644 --- a/src/gui/image/qxpmhandler.cpp +++ b/src/gui/image/qxpmhandler.cpp @@ -42,6 +42,7 @@ #ifndef QT_NO_IMAGEFORMAT_XPM #include <private/qcolor_p.h> +#include <qbytearraymatcher.h> #include <qimage.h> #include <qmap.h> #include <qtextstream.h> @@ -1041,7 +1042,9 @@ bool qt_read_xpm_image_or_array(QIODevice *device, const char * const * source, if ((readBytes = device->readLine(buf.data(), buf.size())) < 0) return false; - if (buf.indexOf("/* XPM") != 0) { + static Q_RELAXED_CONSTEXPR auto matcher = qMakeStaticByteArrayMatcher("/* XPM"); + + if (matcher.indexIn(buf) != 0) { while (readBytes > 0) { device->ungetChar(buf.at(readBytes - 1)); --readBytes; |