LibPDF: Tolerate 0-sized Subrs in PS1 font subprograms

This regressed in 2b3a41be74 in #18031.

Fixes a crash rendering page 2 and onward of
https://pyx-project.org/presentation_dantemv35_en.pdf
This commit is contained in:
Nico Weber 2023-12-15 16:01:29 -05:00 committed by Jelle Raaijmakers
parent b73ae80d8b
commit ee74bc2538

View file

@ -107,7 +107,7 @@ PDFErrorOr<Vector<ByteBuffer>> PS1FontProgram::parse_subroutines(Reader& reader)
return error("Expected array length");
auto length = TRY(parse_int(reader));
VERIFY(length > 0);
VERIFY(length >= 0);
Vector<ByteBuffer> array;
TRY(array.try_resize(length));