From 9fc6967f4fe5a0ea54add461666f8f3ba458cc2d Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Sun, 31 Mar 2019 19:44:01 +0200 Subject: [PATCH] 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 --- src/imageformats/rgb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imageformats/rgb.cpp b/src/imageformats/rgb.cpp index 2eb60a8..432def8 100644 --- a/src/imageformats/rgb.cpp +++ b/src/imageformats/rgb.cpp @@ -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); } ///////////////////////////////////////////////////////////////////////////////