Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
8c50acb9
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,发现更多精彩内容 >>
提交
8c50acb9
编写于
3月 29, 2017
作者:
V
Viktor Szakats
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
silence clang -Wcomma warnings
上级
92fcd25e
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
75 addition
and
33 deletion
+75
-33
png.c
png.c
+31
-14
pngrtran.c
pngrtran.c
+3
-1
pngrutil.c
pngrutil.c
+10
-4
pngset.c
pngset.c
+7
-4
pngtrans.c
pngtrans.c
+24
-10
未找到文件。
png.c
浏览文件 @
8c50acb9
...
...
@@ -2832,7 +2832,7 @@ png_pow10(int power)
if
(
power
<
0
)
{
if
(
power
<
DBL_MIN_10_EXP
)
return
0
;
recip
=
1
,
power
=
-
power
;
recip
=
1
;
power
=
-
power
;
}
if
(
power
>
0
)
...
...
@@ -2910,7 +2910,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
double
test
=
png_pow10
(
exp_b10
+
1
);
if
(
test
<=
DBL_MAX
)
++
exp_b10
,
base
=
test
;
{
++
exp_b10
;
base
=
test
;
}
else
break
;
...
...
@@ -2924,7 +2926,10 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
* test on DBL_MAX above.
*/
fp
/=
base
;
while
(
fp
>=
1
)
fp
/=
10
,
++
exp_b10
;
while
(
fp
>=
1
)
{
fp
/=
10
;
++
exp_b10
;
}
/* Because of the code above fp may, at this point, be
* less than .1, this is ok because the code below can
...
...
@@ -2975,7 +2980,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
/* Rounding up to 10, handle that here. */
if
(
czero
>
0
)
{
--
czero
,
d
=
1
;
--
czero
;
d
=
1
;
if
(
cdigits
==
0
)
--
clead
;
}
else
...
...
@@ -2989,7 +2994,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
else
if
(
ch
==
46
)
{
ch
=
*--
ascii
,
++
size
;
ch
=
*--
ascii
;
++
size
;
/* Advance exp_b10 to '1', so that the
* decimal point happens after the
* previous digit.
...
...
@@ -3016,7 +3021,9 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
int
ch
=
*--
ascii
;
if
(
ch
==
46
)
++
size
,
exp_b10
=
1
;
{
++
size
;
exp_b10
=
1
;
}
/* Else lost a leading zero, so 'exp_b10' is
* still ok at (-1)
...
...
@@ -3052,21 +3059,26 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
if
(
exp_b10
!=
(
-
1
))
{
if
(
exp_b10
==
0
)
*
ascii
++
=
46
,
--
size
;
if
(
exp_b10
==
0
)
{
*
ascii
++
=
46
;
--
size
;
}
/* PLUS 1: TOTAL 4 */
--
exp_b10
;
}
*
ascii
++
=
48
,
--
czero
;
*
ascii
++
=
48
;
--
czero
;
}
if
(
exp_b10
!=
(
-
1
))
{
if
(
exp_b10
==
0
)
*
ascii
++
=
46
,
--
size
;
/* counted above */
{
*
ascii
++
=
46
;
--
size
;
/* counted above */
}
--
exp_b10
;
}
*
ascii
++
=
(
char
)(
48
+
(
int
)
d
)
,
++
cdigits
;
*
ascii
++
=
(
char
)(
48
+
(
int
)
d
)
;
++
cdigits
;
}
}
while
(
cdigits
+
czero
<
precision
+
clead
&&
fp
>
DBL_MIN
);
...
...
@@ -3107,7 +3119,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/
size
-=
cdigits
;
*
ascii
++
=
69
,
--
size
;
/* 'E': PLUS 1 TOTAL 2+precision */
*
ascii
++
=
69
;
--
size
;
/* 'E': PLUS 1 TOTAL 2+precision */
/* The following use of an unsigned temporary avoids ambiguities in
* the signed arithmetic on exp_b10 and permits GCC at least to do
...
...
@@ -3118,7 +3130,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
if
(
exp_b10
<
0
)
{
*
ascii
++
=
45
,
--
size
;
/* '-': PLUS 1 TOTAL 3+precision */
*
ascii
++
=
45
;
--
size
;
/* '-': PLUS 1 TOTAL 3+precision */
uexp_b10
=
(
unsigned
int
)(
-
exp_b10
);
}
...
...
@@ -3185,7 +3197,9 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
/* Avoid overflow here on the minimum integer. */
if
(
fp
<
0
)
*
ascii
++
=
45
,
num
=
(
png_uint_32
)(
-
fp
);
{
*
ascii
++
=
45
;
num
=
(
png_uint_32
)(
-
fp
);
}
else
num
=
(
png_uint_32
)
fp
;
...
...
@@ -3223,7 +3237,10 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
* then ndigits digits to first:
*/
i
=
5
;
while
(
ndigits
<
i
)
*
ascii
++
=
48
,
--
i
;
while
(
ndigits
<
i
)
{
*
ascii
++
=
48
;
--
i
;
}
while
(
ndigits
>=
first
)
*
ascii
++
=
digits
[
--
ndigits
];
/* Don't output the trailing zeros! */
}
...
...
pngrtran.c
浏览文件 @
8c50acb9
...
...
@@ -4601,7 +4601,9 @@ png_do_expand_16(png_row_infop row_info, png_bytep row)
png_byte
*
sp
=
row
+
row_info
->
rowbytes
;
/* source, last byte + 1 */
png_byte
*
dp
=
sp
+
row_info
->
rowbytes
;
/* destination, end + 1 */
while
(
dp
>
sp
)
dp
[
-
2
]
=
dp
[
-
1
]
=
*--
sp
,
dp
-=
2
;
{
dp
[
-
2
]
=
dp
[
-
1
]
=
*--
sp
;
dp
-=
2
;
}
row_info
->
rowbytes
*=
2
;
row_info
->
bit_depth
=
16
;
...
...
pngrutil.c
浏览文件 @
8c50acb9
...
...
@@ -3377,7 +3377,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
*/
do
{
dp
[
0
]
=
sp
[
0
]
,
dp
[
1
]
=
sp
[
1
];
dp
[
0
]
=
sp
[
0
]
;
dp
[
1
]
=
sp
[
1
];
if
(
row_width
<=
bytes_to_jump
)
return
;
...
...
@@ -3398,7 +3398,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
*/
for
(;;)
{
dp
[
0
]
=
sp
[
0
]
,
dp
[
1
]
=
sp
[
1
],
dp
[
2
]
=
sp
[
2
];
dp
[
0
]
=
sp
[
0
]
;
dp
[
1
]
=
sp
[
1
];
dp
[
2
]
=
sp
[
2
];
if
(
row_width
<=
bytes_to_jump
)
return
;
...
...
@@ -3887,7 +3887,10 @@ png_read_filter_row_paeth_1byte_pixel(png_row_infop row_info, png_bytep row,
/* Find the best predictor, the least of pa, pb, pc favoring the earlier
* ones in the case of a tie.
*/
if
(
pb
<
pa
)
pa
=
pb
,
a
=
b
;
if
(
pb
<
pa
)
{
pa
=
pb
;
a
=
b
;
}
if
(
pc
<
pa
)
a
=
c
;
/* Calculate the current pixel in a, and move the previous row pixel to c
...
...
@@ -3939,7 +3942,10 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row,
pc
=
(
p
+
pc
)
<
0
?
-
(
p
+
pc
)
:
p
+
pc
;
#endif
if
(
pb
<
pa
)
pa
=
pb
,
a
=
b
;
if
(
pb
<
pa
)
{
pa
=
pb
;
a
=
b
;
}
if
(
pc
<
pa
)
a
=
c
;
a
+=
*
row
;
...
...
pngset.c
浏览文件 @
8c50acb9
...
...
@@ -1102,8 +1102,9 @@ png_set_sPLT(png_const_structrp png_ptr,
info_ptr
->
valid
|=
PNG_INFO_sPLT
;
++
(
info_ptr
->
splt_palettes_num
);
++
np
;
++
entries
;
}
while
(
++
entries
,
--
nentries
);
while
(
--
nentries
);
if
(
nentries
>
0
)
png_chunk_report
(
png_ptr
,
"sPLT out of memory"
,
PNG_CHUNK_WRITE_ERROR
);
...
...
@@ -1696,14 +1697,16 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
png_byte
ch
=
(
png_byte
)
*
key
++
;
if
((
ch
>
32
&&
ch
<=
126
)
||
(
ch
>=
161
/*&& ch <= 255*/
))
*
new_key
++
=
ch
,
++
key_len
,
space
=
0
;
{
*
new_key
++
=
ch
;
++
key_len
;
space
=
0
;
}
else
if
(
space
==
0
)
{
/* A space or an invalid character when one wasn't seen immediately
* before; output just a space.
*/
*
new_key
++
=
32
,
++
key_len
,
space
=
1
;
*
new_key
++
=
32
;
++
key_len
;
space
=
1
;
/* If the character was not a space then it is invalid. */
if
(
ch
!=
32
)
...
...
@@ -1716,7 +1719,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
if
(
key_len
>
0
&&
space
!=
0
)
/* trailing space */
{
--
key_len
,
--
new_key
;
--
key_len
;
--
new_key
;
if
(
bad_character
==
0
)
bad_character
=
32
;
}
...
...
pngtrans.c
浏览文件 @
8c50acb9
...
...
@@ -514,11 +514,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if
(
at_start
!=
0
)
/* Skip initial filler */
++
sp
;
else
/* Skip initial channel and, for sp, the filler */
sp
+=
2
,
++
dp
;
{
sp
+=
2
;
++
dp
;
}
/* For a 1 pixel wide image there is nothing to do */
while
(
sp
<
ep
)
*
dp
++
=
*
sp
,
sp
+=
2
;
{
*
dp
++
=
*
sp
;
sp
+=
2
;
}
row_info
->
pixel_depth
=
8
;
}
...
...
@@ -528,10 +532,14 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if
(
at_start
!=
0
)
/* Skip initial filler */
sp
+=
2
;
else
/* Skip initial channel and, for sp, the filler */
sp
+=
4
,
dp
+=
2
;
{
sp
+=
4
;
dp
+=
2
;
}
while
(
sp
<
ep
)
*
dp
++
=
*
sp
++
,
*
dp
++
=
*
sp
,
sp
+=
3
;
{
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
;
sp
+=
3
;
}
row_info
->
pixel_depth
=
16
;
}
...
...
@@ -554,11 +562,15 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if
(
at_start
!=
0
)
/* Skip initial filler */
++
sp
;
else
/* Skip initial channels and, for sp, the filler */
sp
+=
4
,
dp
+=
3
;
{
sp
+=
4
;
dp
+=
3
;
}
/* Note that the loop adds 3 to dp and 4 to sp each time. */
while
(
sp
<
ep
)
*
dp
++
=
*
sp
++
,
*
dp
++
=
*
sp
++
,
*
dp
++
=
*
sp
,
sp
+=
2
;
{
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
;
sp
+=
2
;
}
row_info
->
pixel_depth
=
24
;
}
...
...
@@ -568,14 +580,16 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
if
(
at_start
!=
0
)
/* Skip initial filler */
sp
+=
2
;
else
/* Skip initial channels and, for sp, the filler */
sp
+=
8
,
dp
+=
6
;
{
sp
+=
8
;
dp
+=
6
;
}
while
(
sp
<
ep
)
{
/* Copy 6 bytes, skip 2 */
*
dp
++
=
*
sp
++
,
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
++
,
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
++
,
*
dp
++
=
*
sp
,
sp
+=
3
;
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
++
;
*
dp
++
=
*
sp
;
sp
+=
3
;
}
row_info
->
pixel_depth
=
48
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录