Commit Diff


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"))