Commit Diff


commit - c9ab81f899e5ed4668d95cf5d250364c5ba50922
commit + 669790f191189a4e1c9416572909dd3a158547f5
blob - c2d370e2a67ee3320b3b7ed10179087ef21e2ecb
blob + a559b5fa565035ded75e18332670c06ebd382dc4
--- 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 chains; 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"))