瀏覽代碼

LibPDF: Tolerate 0-sized Subrs in PS1 font subprograms

This regressed in 2b3a41be74a3e8 in #18031.

Fixes a crash rendering page 2 and onward of
https://pyx-project.org/presentation_dantemv35_en.pdf
Nico Weber 1 年之前
父節點
當前提交
ee74bc2538
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibPDF/Fonts/PS1FontProgram.cpp

+ 1 - 1
Userland/Libraries/LibPDF/Fonts/PS1FontProgram.cpp

@@ -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));