Fix maximum number of channels (testcase added)

This commit is contained in:
Mirco Miranda 2022-09-22 08:48:47 +02:00 committed by Albert Astals Cid
parent 72a1cc23b1
commit 2f27dff48b
3 changed files with 3 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

View File

@ -643,7 +643,9 @@ static bool IsValid(const PSDHeader &header)
qDebug() << "PSD header: invalid color mode" << header.color_mode;
return false;
}
if (header.channel_count < 1 || header.channel_count > 56) {
// Specs tells: "Supported range is 1 to 56" but the limit is 57:
// Photoshop does not make you add more (see also 53alphas.psd test case).
if (header.channel_count < 1 || header.channel_count > 57) {
qDebug() << "PSD header: invalid number of channels" << header.channel_count;
return false;
}