Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
db67cba8
T
Third Party Libpng
项目概览
OpenHarmony
/
Third Party Libpng
大约 1 年 前同步成功
通知
4
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Libpng
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
db67cba8
编写于
5月 07, 2013
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libpng16] Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart).
Ignore "#" delimited comments in input file to pnm2png.c.
上级
2aa6c96e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
64 addition
and
21 deletion
+64
-21
ANNOUNCE
ANNOUNCE
+9
-2
CHANGES
CHANGES
+8
-1
contrib/pngminus/pnm2png.c
contrib/pngminus/pnm2png.c
+16
-3
pngrutil.c
pngrutil.c
+31
-15
未找到文件。
ANNOUNCE
浏览文件 @
db67cba8
Libpng 1.6.3beta05 - May
6
, 2013
Libpng 1.6.3beta05 - May
7
, 2013
This is not intended to be a public release. It will be replaced
within a few weeks by a public version or by another test version.
...
...
@@ -45,7 +45,14 @@ Version 1.6.3beta04 [May 6, 2013]
Calculate our own zlib windowBits when decoding rather than trusting the
CMF bytes in the PNG datastream.
Version 1.6.3beta05 [May 6, 2013]
Version 1.6.3beta05 [May 7, 2013]
Choose to use windowBits==15 or the zlib header setting via the
benign-errors setting. If benign errors are allowed, then ignore
the windowBits setting in the zlib header.
Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so
undid the improvement in beta04.
Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart).
Ignore "#" delimited comments in input file to pnm2png.c.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
CHANGES
浏览文件 @
db67cba8
...
...
@@ -4528,7 +4528,14 @@ Version 1.6.3beta04 [May 6, 2013]
Calculate our own zlib windowBits when decoding rather than trusting the
CMF bytes in the PNG datastream.
Version 1.6.3beta05 [May 6, 2013]
Version 1.6.3beta05 [May 7, 2013]
Choose to use windowBits==15 or the zlib header setting via the
benign-errors setting. If benign errors are allowed, then ignore
the windowBits setting in the zlib header.
Zlib-1.2.8 and earlier don't allow us to decrease the windowBits, so
undid the improvement in beta04.
Check for EOF in contrib/pngminus/pnm2png.c (Paul Stewart).
Ignore "#" delimited comments in input file to pnm2png.c.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
contrib/pngminus/pnm2png.c
浏览文件 @
db67cba8
...
...
@@ -460,19 +460,32 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace,
void
get_token
(
FILE
*
pnm_file
,
char
*
token
)
{
int
i
=
0
;
int
ret
;
/* remove white-space */
/* remove white-space
and comment lines
*/
do
{
token
[
i
]
=
(
unsigned
char
)
fgetc
(
pnm_file
);
ret
=
fgetc
(
pnm_file
);
if
(
ret
==
'#'
)
{
/* the rest of this line is a comment */
do
{
ret
=
fgetc
(
pnm_file
);
}
while
((
ret
!=
'\n'
)
&&
(
ret
!=
'\r'
)
&&
(
ret
!=
EOF
));
}
if
(
ret
==
EOF
)
break
;
token
[
i
]
=
(
unsigned
char
)
ret
;
}
while
((
token
[
i
]
==
'\n'
)
||
(
token
[
i
]
==
'\r'
)
||
(
token
[
i
]
==
' '
));
/* read string */
do
{
ret
=
fgetc
(
pnm_file
);
if
(
ret
==
EOF
)
break
;
i
++
;
token
[
i
]
=
(
unsigned
char
)
fgetc
(
pnm_file
)
;
token
[
i
]
=
(
unsigned
char
)
ret
;
}
while
((
token
[
i
]
!=
'\n'
)
&&
(
token
[
i
]
!=
'\r'
)
&&
(
token
[
i
]
!=
' '
));
...
...
pngrutil.c
浏览文件 @
db67cba8
...
...
@@ -4163,7 +4163,8 @@ png_read_finish_row(png_structrp png_ptr)
}
#endif
/* PNG_SEQUENTIAL_READ_SUPPORTED */
#ifdef PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED
#ifdef PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED
#if ZLIB_VERNUM > 0x1280
/* This is the code to to select a windowBits value to match the smallest
* possible sliding window needed to contain the entire uncompressed image.
*/
...
...
@@ -4230,6 +4231,7 @@ png_read_image_size(png_structrp png_ptr)
return
0xffffffffU
;
}
#endif
/* ZLIB_VERNUM */
#endif
/* PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED */
void
/* PRIVATE */
...
...
@@ -4516,23 +4518,37 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
png_free
(
png_ptr
,
buffer
);
}
/* Finally claim the zstream for the inflate of the IDAT data, using the
* windowBts predicted from the uncompressed data size, not the value from
* the stream. If READ_OPTIMIZE_WINDOWBITS_SUPPORTED is not defined, then
* simply use a 32kbyte window (windowBits=15).
*
* To do: make this behavior optional via a run-time png_set_something(),
* with options to use windowBits=0 (use the zlib header data),
* windowBits=15 (use a 32kbyte window), or required_window_bits
* computed from the image size, pixel size, and interlacing setting.
*/
#ifdef PNG_READ_OPTIMIZE_WINDOWBITS_SUPPORTED
if
(
png_inflate_claim
(
png_ptr
,
png_IDAT
,
required_window_bits
(
png_read_image_size
(
png_ptr
)))
!=
Z_OK
)
/* To do in libpng17: get windowBits from the CMF bytes and select the
* smaller of that and the required_window_bits. Requires a one-byte
* lookahead into the first IDAT chunk data, and requires actually
* injecting the revised CMF bytes into the datastream before reading.
*/
{
#if ZLIB_VERNUM < 0x1290
unsigned
int
windowBits
;
#endif
/* ZLIB_VERNUM */
if
(
png_ptr
->
flags
&
PNG_FLAG_BENIGN_ERRORS_WARN
)
{
#if ZLIB_VERNUM < 0x1290
windowBits
=
15
;
#else
if
(
png_inflate_claim
(
png_ptr
,
png_IDAT
,
15
)
!=
Z_OK
)
/* Compute required windowBits from the image size, pixel size, and
* interlacing setting.
*/
windowBits
=
required_window_bits
(
png_read_image_size
(
png_ptr
));
#endif
/* ZLIB_VERNUM */
}
else
#endif
png_error
(
png_ptr
,
png_ptr
->
zstream
.
msg
);
windowBits
=
0
;
/* Use the setting from the zlib CMF bytes */
/* Finally claim the zstream for the inflate of the IDAT data */
if
(
png_inflate_claim
(
png_ptr
,
png_IDAT
,
windowBits
)
!=
Z_OK
)
png_error
(
png_ptr
,
png_ptr
->
zstream
.
msg
);
}
png_ptr
->
flags
|=
PNG_FLAG_ROW_INIT
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录