1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +00:00

LibPDF: Allow /Pattern to be used directly as a color space name

Per spec:

"If the color space is one that can be specified by a name and no
additional parameters (DeviceGray, DeviceRGB, DeviceCMYK, and certain
cases of Pattern), the name may be specified directly."

We still don't implement /Pattern color spaces, but now we no longer
crash trying to look up the potentially-nonexistent /ColorSpace
dictionary on the page object when /Pattern is used directly as color
space name.

On top of #21514, reduces number of crashes on 300 random PDFs from the
web (the first 300 from 0000.zip from
https://pdfa.org/new-large-scale-pdf-corpus-now-publicly-available/)
from 42 (14%) to 34 (11%).
This commit is contained in:
Nico Weber 2023-10-20 11:12:38 -04:00 committed by Andrew Kaster
parent aea0e2f313
commit e0268dcc87
2 changed files with 3 additions and 1 deletions

View file

@ -21,7 +21,7 @@
V(Lab, false) \
V(ICCBased, false) \
V(Indexed, false) \
V(Pattern, false) \
V(Pattern, true) \
V(Separation, false) \
V(DeviceN, false)