Fix PNM decoder in case of missing tags

Change-Id: I6a760ff02d94f6af969d483e3f3e2731ad7eb41e
This commit is contained in:
Vincent Rabaud
2026-03-15 20:20:50 +01:00
parent f342dfc175
commit 561325651c

View File

@@ -127,7 +127,7 @@ static size_t ReadPAMFields(PNMInfo* const info, size_t off) {
return 0;
}
}
if (!(info->seen_flags & ALL_NEEDED_FLAGS)) {
if ((info->seen_flags & ALL_NEEDED_FLAGS) != ALL_NEEDED_FLAGS) {
fprintf(stderr, "PAM header error: missing tags%s%s%s%s\n",
(info->seen_flags & WIDTH_FLAG) ? "" : " WIDTH",
(info->seen_flags & HEIGHT_FLAG) ? "" : " HEIGHT",