summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2012-10-02 15:38:29 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-02 19:54:43 +0200
commita0af0fbcd4a41fb7be6abf558296682182cdffa0 (patch)
tree0ce4970d3aaa28606a24cefaf28c21ff72d56b00 /src/gui
parent7c382d81d9fb622f9e9c813c3a7e44ded11e60e0 (diff)
Fix DIB image reading.
Position the QIODevice correctly for DIB (==BMP without file header). Task-number: QTBUG-26690 Change-Id: I7922b4e830a92dcc19f1b52e305ca9ff3fd5d9f5 Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/image/qbmphandler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/image/qbmphandler.cpp b/src/gui/image/qbmphandler.cpp
index 600a24ec24..49aeee6d7b 100644
--- a/src/gui/image/qbmphandler.cpp
+++ b/src/gui/image/qbmphandler.cpp
@@ -757,7 +757,10 @@ bool QBmpHandler::read(QImage *image)
s.setByteOrder(QDataStream::LittleEndian);
// read image
- if (!read_dib_body(s, infoHeader, fileHeader.bfOffBits, startpos, *image))
+ const bool readSuccess = m_format == BmpFormat ?
+ read_dib_body(s, infoHeader, fileHeader.bfOffBits, startpos, *image) :
+ read_dib_body(s, infoHeader, -1, startpos - BMP_FILEHDR_SIZE, *image);
+ if (!readSuccess)
return false;
state = Ready;