From 532b57fb3f2433a3db04907832f2a8e3bb81ea7a Mon Sep 17 00:00:00 2001 From: Pompolic <pompolic@special-circumstanc.es> Date: Mon, 13 Dec 2021 17:55:16 +0100 Subject: [PATCH] Fix incorrect predicate in BitsPerComponent check in filters --- pdf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdf.c b/pdf.c index 9a77286..aa2ed6e 100644 --- a/pdf.c +++ b/pdf.c @@ -3112,7 +3112,7 @@ FlateDecode(const Dict *parms, HBytes b, HParser *p) fprintf(stderr, "FlateDecode: /Colors has an invalid value of %d\n", pred.colors); return NULL; } - if(pred.bpc != 1 || pred.bpc != 2 || pred.bpc != 4 || pred.bpc != 8) + if(pred.bpc != 1 && pred.bpc != 2 && pred.bpc != 4 && pred.bpc != 8 && pred.bpc != 16) { fprintf(stderr, "FlateDecode: /BitsPerComponent has an invalid value of %d\n", pred.bpc); return NULL; @@ -3263,7 +3263,7 @@ LZWDecode(const Dict *parms, HBytes b, HParser *p) fprintf(stderr, "LZWDecode: /Colors has an invalid value of %d\n", pred.colors); return NULL; } - if(pred.bpc != 1 || pred.bpc != 2 || pred.bpc != 4 || pred.bpc != 8) + if(pred.bpc != 1 && pred.bpc != 2 && pred.bpc != 4 && pred.bpc != 8 && pred.bpc != 16) { fprintf(stderr, "LZWDecode: /BitsPerComponent has an invalid value of %d\n", pred.bpc); return NULL; -- GitLab