summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-05-13 12:48:52 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-13 12:56:34 +0200
commiteec8ed4818fe4178df5443dc96afccb3925723c4 (patch)
tree8a09977e703f43bea175ab3c4c5e350fd029fd79
parentf293cc8539da5d4ea915c957abbba473515793ad (diff)
TGA-Reader: Bail out of check if the device is not seekable.
Suppress warning 'QIODevice::seek: Cannot call seek on a sequential device' which is emitted further down when attempting to restore the position of the file. Task-number: QTBUG-31081 Change-Id: Ib6a4b3eecaa61905a29020e5dd428f1516bfba7f Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
-rw-r--r--src/plugins/imageformats/tga/qtgahandler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/imageformats/tga/qtgahandler.cpp b/src/plugins/imageformats/tga/qtgahandler.cpp
index fe1b09b..f446db1 100644
--- a/src/plugins/imageformats/tga/qtgahandler.cpp
+++ b/src/plugins/imageformats/tga/qtgahandler.cpp
@@ -80,6 +80,8 @@ bool QTgaHandler::canRead(QIODevice *device)
// TGA reader implementation needs a seekable QIODevice, so
// sequential devices are not supported
+ if (device->isSequential())
+ return false;
qint64 pos = device->pos();
bool isValid;
{