From 561325651c9087015f665dd953574824a3dd9b92 Mon Sep 17 00:00:00 2001 From: Vincent Rabaud Date: Sun, 15 Mar 2026 20:20:50 +0100 Subject: [PATCH] Fix PNM decoder in case of missing tags Change-Id: I6a760ff02d94f6af969d483e3f3e2731ad7eb41e --- imageio/pnmdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imageio/pnmdec.c b/imageio/pnmdec.c index cad7b140..a5218daf 100644 --- a/imageio/pnmdec.c +++ b/imageio/pnmdec.c @@ -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",