Commit 67e7a44a authored by Liang Qi's avatar Liang Qi
Browse files

Merge remote-tracking branch 'origin/5.8' into dev

Conflicts:
	.qmake.conf

Change-Id: I519c785ed64bdb0669d884a11d45be6532e629ec
parents e349e6df 0870e670
No related merge requests found
Showing with 3 additions and 7 deletions
...@@ -144,9 +144,7 @@ QTgaFile::QTgaFile(QIODevice *device) ...@@ -144,9 +144,7 @@ QTgaFile::QTgaFile(QIODevice *device)
mErrorMessage = tr("Seek file/device for image read failed"); mErrorMessage = tr("Seek file/device for image read failed");
return; return;
} }
int bytes = device->read((char*)mHeader, HeaderSize); if (device->read(reinterpret_cast<char*>(mHeader), HeaderSize) != HeaderSize) {
if (bytes != HeaderSize)
{
mErrorMessage = tr("Image header read failed"); mErrorMessage = tr("Image header read failed");
return; return;
} }
...@@ -170,9 +168,7 @@ QTgaFile::QTgaFile(QIODevice *device) ...@@ -170,9 +168,7 @@ QTgaFile::QTgaFile(QIODevice *device)
return; return;
} }
char footer[FooterSize]; char footer[FooterSize];
bytes = mDevice->read((char*)footer, FooterSize); if (mDevice->read(reinterpret_cast<char*>(footer), FooterSize) != FooterSize) {
if (bytes != FooterSize)
{
mErrorMessage = tr("Could not read footer"); mErrorMessage = tr("Could not read footer");
} }
if (qstrncmp(&footer[SignatureOffset], "TRUEVISION-XFILE", 16) != 0) if (qstrncmp(&footer[SignatureOffset], "TRUEVISION-XFILE", 16) != 0)
......
...@@ -244,7 +244,7 @@ bool WBMPReader::canRead(QIODevice *device) ...@@ -244,7 +244,7 @@ bool WBMPReader::canRead(QIODevice *device)
WBMPHeader hdr; WBMPHeader hdr;
if (readWBMPHeader(device, &hdr)) { if (readWBMPHeader(device, &hdr)) {
if ((hdr.type == 0) && (hdr.format == 0)) { 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(); qint64 available = device->bytesAvailable();
device->seek(oldPos); device->seek(oldPos);
return (imageSize == available); return (imageSize == available);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment