diff options
author | Liang Qi <liang.qi@qt.io> | 2017-01-25 09:50:12 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-01-25 09:50:12 +0100 |
commit | 67e7a44a06d5d4d1c98d04f4b0e1a07583f3bfa5 (patch) | |
tree | 5fe9c251d3fe9dbf4a21608e02bf424a312b8921 | |
parent | e349e6df7a08b4aa15a63fa5f1dcd0f36d598d53 (diff) | |
parent | 0870e670665a702665948723bb7b1eb61a9572a8 (diff) | |
download | qtimageformats-67e7a44a06d5d4d1c98d04f4b0e1a07583f3bfa5.tar.gz |
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts:
.qmake.conf
Change-Id: I519c785ed64bdb0669d884a11d45be6532e629ec
-rw-r--r-- | src/plugins/imageformats/tga/qtgafile.cpp | 8 | ||||
-rw-r--r-- | src/plugins/imageformats/wbmp/qwbmphandler.cpp | 2 |
2 files changed, 3 insertions, 7 deletions
diff --git a/src/plugins/imageformats/tga/qtgafile.cpp b/src/plugins/imageformats/tga/qtgafile.cpp index 14a7a74..e2f20a7 100644 --- a/src/plugins/imageformats/tga/qtgafile.cpp +++ b/src/plugins/imageformats/tga/qtgafile.cpp @@ -144,9 +144,7 @@ QTgaFile::QTgaFile(QIODevice *device) mErrorMessage = tr("Seek file/device for image read failed"); return; } - int bytes = device->read((char*)mHeader, HeaderSize); - if (bytes != HeaderSize) - { + if (device->read(reinterpret_cast<char*>(mHeader), HeaderSize) != HeaderSize) { mErrorMessage = tr("Image header read failed"); return; } @@ -170,9 +168,7 @@ QTgaFile::QTgaFile(QIODevice *device) return; } char footer[FooterSize]; - bytes = mDevice->read((char*)footer, FooterSize); - if (bytes != FooterSize) - { + if (mDevice->read(reinterpret_cast<char*>(footer), FooterSize) != FooterSize) { mErrorMessage = tr("Could not read footer"); } if (qstrncmp(&footer[SignatureOffset], "TRUEVISION-XFILE", 16) != 0) diff --git a/src/plugins/imageformats/wbmp/qwbmphandler.cpp b/src/plugins/imageformats/wbmp/qwbmphandler.cpp index 0d08422..5fe8ec9 100644 --- a/src/plugins/imageformats/wbmp/qwbmphandler.cpp +++ b/src/plugins/imageformats/wbmp/qwbmphandler.cpp @@ -244,7 +244,7 @@ bool WBMPReader::canRead(QIODevice *device) WBMPHeader hdr; if (readWBMPHeader(device, &hdr)) { if ((hdr.type == 0) && (hdr.format == 0)) { - qint64 imageSize = hdr.height * ((hdr.width + 7) / 8); + const qint64 imageSize = hdr.height * ((qint64(hdr.width) + 7) / 8); qint64 available = device->bytesAvailable(); device->seek(oldPos); return (imageSize == available); |