0 Star 0 Fork 24

Liquor/ghostscript

forked from src-openEuler/ghostscript 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
PDF-interpreter-swallow-errors-reading-ICC-profiles-and-continue.patch 1.78 KB
一键复制 编辑 原始数据 按行查看 历史
wangchen 提交于 2020-09-03 15:54 . Sync some patches from community
From a45d7217c8c1578475ee9204d1f4ad46520f44d1 Mon Sep 17 00:00:00 2001
From: Ken Sharp <ken.sharp@artifex.com>
Date: Sat, 21 Mar 2020 10:00:42 +0000
Subject: [PATCH] PDF interpreter - swallow errors reading ICC profiles and
continue
Bug #702240 "Invalid ICC profile aborts PDF ineterpretation"
The file contains an ICCbased space which references an embedded ICC
profile, which is Flate compressed. The compressed stream has been
corrupted and cannot be decompressed.
This causes the colour space code to throw an ioerror and terminate
interpretation, Acrobat (as usual) doesn't even give a warning.
This commit checks for an error creating the ReusableStreamDecode and
if it fails sets the Data Source in the stream dictionary to null. We
will later use the /N value in the stream dictionary to set a reasonable
fallback space (in this case CMYK).
---
Resource/Init/pdf_draw.ps | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Resource/Init/pdf_draw.ps b/Resource/Init/pdf_draw.ps
index 1deb052..9d818de 100644
--- a/Resource/Init/pdf_draw.ps
+++ b/Resource/Init/pdf_draw.ps
@@ -874,7 +874,15 @@ currentdict /csncompdict undef
dup dup 1 oget
mark exch { oforce } forall .dicttomark
dup dup //true resolvestream
- /ReusableStreamDecode filter /DataSource exch put
+ {
+ /ReusableStreamDecode filter
+ } stopped
+ {
+ pop null
+% ( **** Error: Failed to read ICC profile for an ICCBased colour space.\n) pdfformaterror
+% ( Falling back to a colour space determined by the /N value.\n) pdfformaterror
+ }if
+ /DataSource exch put
dup /.hash 0 put % placeholder for use by seticc icc_profile_cache key
% Check that the number of components (/N) defined in the ICCBased
% dictionry matches the actual profile. Bug #696120
--
1.8.3.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/liquor1/ghostscript.git
git@gitee.com:liquor1/ghostscript.git
liquor1
ghostscript
ghostscript
master

搜索帮助