commit 79dc4dd64dee4c459207a6f7c8c1cd18c824fda7 from: pompolic date: Fri Mar 05 18:18:06 2021 UTC Merge branch 'fix-decode-assert-fail' into 'master' Report incorrect /Filter type with decode failure See merge request pesco/pdf!18 commit - 7dbed70aae6b21401a7cfcbf4b8e06c119b7d1ca commit + 79dc4dd64dee4c459207a6f7c8c1cd18c824fda7 blob - 563f04564f1b222ec6789657acf2d6b443498f63 blob + d4b299da2f823e3a5394cfbf9c7ae8860a9fc490 --- pdf.c +++ pdf.c @@ -1902,9 +1902,12 @@ decode_stream(const Dict *d, HBytes b, HParser *p) errx(1, "stream data parser: LL(1) compile failed"); #endif - if (v->token_type == TT_SEQUENCE) - return NULL; // XXX filter chains not supported, yet - assert(v->token_type == TT_BYTES); + if (v->token_type != TT_BYTES) { + // XXX TT_SEQUENCE would be a filter chain; that’s not supported, yet. + // But it might also be something bogus, in which case we should fail. + return NULL; + } + if (bytes_eq(v->bytes, "FlateDecode")) filter = FlateDecode; else if (bytes_eq(v->bytes, "ASCIIHexDecode"))