Added limit to maximum number of channels

This commit is contained in:
Mirco Miranda
2026-06-10 04:33:37 +02:00
committed by Mirco Miranda
parent 8bfdef2e48
commit 52045ff84d
5 changed files with 13 additions and 14 deletions
+1 -1
View File
@@ -105,7 +105,7 @@ static bool IsSupported(const QoiHeader &head)
return false;
}
// Check if the header is a valid QOI header
if (head.Width == 0 || head.Height == 0 || head.Channels < 3 || head.Colorspace > 1) {
if (head.Width == 0 || head.Height == 0 || head.Channels < 3 || head.Channels > 4 || head.Colorspace > 1) {
return false;
}
// Set a reasonable upper limit