From bc066012d4c92e626da3d1ff45c56b822639d22b Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 4 Aug 2021 17:32:33 +0300 Subject: [PATCH] assume plugins do not change the device position in createReadHandlerHelper() function Signed-off-by: Ivailo Monev --- src/gui/image/qimagereader.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/gui/image/qimagereader.cpp b/src/gui/image/qimagereader.cpp index 87560fff6..e152c3839 100644 --- a/src/gui/image/qimagereader.cpp +++ b/src/gui/image/qimagereader.cpp @@ -216,7 +216,6 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, // check if any plugin recognize the format if (!handler && !form.isEmpty()) { - const qint64 pos = device ? device->pos() : 0; foreach (const QString &key, keys) { QImageIOPlugin *plugin = qobject_cast(l->instance(key)); if (plugin && plugin->capabilities(device, form) & QImageIOPlugin::CanRead) { @@ -227,13 +226,10 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, break; } } - if (device && !device->isSequential()) - device->seek(pos); } // check if any plugin recognize the content if (!handler && device && autoDetectImageFormat) { - const qint64 pos = device->pos(); foreach (const QString &key, keys) { QImageIOPlugin *plugin = qobject_cast(l->instance(key)); if (plugin && plugin->capabilities(device, QByteArray()) & QImageIOPlugin::CanRead) { @@ -244,8 +240,6 @@ static QImageIOHandler *createReadHandlerHelper(QIODevice *device, break; } } - if (!device->isSequential()) - device->seek(pos); } #endif // QT_NO_LIBRARY -- 2.11.0