mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-06-28 07:59:13 -04:00
Added limit to maximum number of channels
This commit is contained in:
committed by
Mirco Miranda
parent
8bfdef2e48
commit
52045ff84d
@@ -728,7 +728,7 @@ static bool IsValid(const PSDHeader &header)
|
||||
}
|
||||
// Specs tells: "Supported range is 1 to 56" but when the alpha channel is present 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) {
|
||||
if (header.channel_count < 1 || header.channel_count > std::min(57, KIF_MAX_IMAGE_CHANNELS)) {
|
||||
qCDebug(LOG_PSDPLUGIN) << "PSD header: invalid number of channels" << header.channel_count;
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user