Fix RGBHandler::canRead

Summary:
As one can see in SGIImage::readImage the accepted images are

    _stream >> u16;
    if (u16 != 0x01da) {
        return false;
    }

    _stream >> _rle;
    if (_rle > 1) {
        return false;
    }

so not only \x01\xda\x01 but also \x01\xda\x00

Reviewers: svuorela

Reviewed By: svuorela

Subscribers: svuorela, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D20145
This commit is contained in:
Albert Astals Cid 2019-03-31 19:44:01 +02:00
parent bd704045e6
commit 9fc6967f4f

View File

@ -709,7 +709,7 @@ bool RGBHandler::canRead(QIODevice *device)
device->seek(oldPos);
}
return head.size() >= 4 && head.startsWith("\x01\xda\x01") && (head[3] == 1 || head[3] == 2);
return head.size() >= 4 && head.startsWith("\x01\xda") && (head[2] == 0 || head[2] == 1) && (head[3] == 1 || head[3] == 2);
}
///////////////////////////////////////////////////////////////////////////////