Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
e018ab98
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,发现更多精彩内容 >>
提交
e018ab98
编写于
8月 10, 2016
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'libpng16' of
git://github.com/jbowler/libpng
into libpng16
上级
19fefd3a
92a7c79d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
89 addition
and
44 deletion
+89
-44
ANNOUNCE
ANNOUNCE
+3
-2
CHANGES
CHANGES
+2
-1
png.c
png.c
+41
-7
pngpriv.h
pngpriv.h
+3
-1
pngtest.c
pngtest.c
+40
-33
未找到文件。
ANNOUNCE
浏览文件 @
e018ab98
Libpng 1.6.25beta01 - August 1
0
, 2016
Libpng 1.6.25beta01 - August 1
1
, 2016
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.
...
...
@@ -25,10 +25,11 @@ Other information:
Changes since the last public release (1.6.24):
Version 1.6.25beta01 [August 1
0
, 2016]
Version 1.6.25beta01 [August 1
1
, 2016]
Return NULL from png_malloc_array() with a warning instead of calling
png_error() on failure.
Reject oversized iCCP profile immediately.
Cleaned up PNG_DEBUG compile of pngtest.c.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
CHANGES
浏览文件 @
e018ab98
...
...
@@ -5675,10 +5675,11 @@ Version 1.6.24rc03 [August 2, 2016]
Version 1.6.24[August 4, 2016]
No changes.
Version 1.6.25beta01 [August 1
0
, 2016]
Version 1.6.25beta01 [August 1
1
, 2016]
Return NULL from png_malloc_array() with a warning instead of calling
png_error() on failure.
Reject oversized iCCP profile immediately.
Cleaned up PNG_DEBUG compile of pngtest.c.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
png.c
浏览文件 @
e018ab98
/* png.c - location for general purpose libpng functions
*
* Last changed in libpng 1.6.2
4 [August 4, 2016
]
* Copyright (c) 1998-2002,2004,2006-201
5
Glenn Randers-Pehrson
* Last changed in libpng 1.6.2
5 [(PENDING RELEASE)
]
* Copyright (c) 1998-2002,2004,2006-201
6
Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*
...
...
@@ -775,14 +775,14 @@ png_get_copyright(png_const_structrp png_ptr)
#else
# ifdef __STDC__
return
PNG_STRING_NEWLINE
\
"libpng version 1.6.25beta01 - August
4
, 2016"
PNG_STRING_NEWLINE
\
"libpng version 1.6.25beta01 - August
11
, 2016"
PNG_STRING_NEWLINE
\
"Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson"
\
PNG_STRING_NEWLINE
\
"Copyright (c) 1996-1997 Andreas Dilger"
PNG_STRING_NEWLINE
\
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."
\
PNG_STRING_NEWLINE
;
# else
return
"libpng version 1.6.25beta01 - August
4
, 2016\
return
"libpng version 1.6.25beta01 - August
11
, 2016\
Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."
;
...
...
@@ -1931,8 +1931,8 @@ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace,
static
const
png_byte
D50_nCIEXYZ
[
12
]
=
{
0x00
,
0x00
,
0xf6
,
0xd6
,
0x00
,
0x01
,
0x00
,
0x00
,
0x00
,
0x00
,
0xd3
,
0x2d
};
int
/* PRIVATE
*/
png_
icc_check_length
(
png_const_structrp
png_ptr
,
png_colorspacerp
colorspace
,
static
int
/* bool
*/
icc_check_length
(
png_const_structrp
png_ptr
,
png_colorspacerp
colorspace
,
png_const_charp
name
,
png_uint_32
profile_length
)
{
if
(
profile_length
<
132
)
...
...
@@ -1942,6 +1942,40 @@ png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
return
1
;
}
#ifdef PNG_READ_iCCP_SUPPORTED
int
/* PRIVATE */
png_icc_check_length
(
png_const_structrp
png_ptr
,
png_colorspacerp
colorspace
,
png_const_charp
name
,
png_uint_32
profile_length
)
{
if
(
!
icc_check_length
(
png_ptr
,
colorspace
,
name
,
profile_length
))
return
0
;
/* This needs to be here because the 'normal' check is in
* png_decompress_chunk, yet this happens after the attempt to
* png_malloc_base the required data. We only need this on read; on write
* the caller supplies the profile buffer so libpng doesn't allocate it. See
* the call to icc_check_length below (the write case).
*/
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
else
if
(
png_ptr
->
user_chunk_malloc_max
>
0
&&
png_ptr
->
user_chunk_malloc_max
<
profile_length
)
return
png_icc_profile_error
(
png_ptr
,
colorspace
,
name
,
profile_length
,
"exceeds application limits"
);
# elif PNG_USER_CHUNK_MALLOC_MAX > 0
else
if
(
PNG_USER_CHUNK_MALLOC_MAX
<
profile_length
)
return
png_icc_profile_error
(
png_ptr
,
colorspace
,
name
,
profile_length
,
"exceeds libpng limits"
);
# else
/* !SET_USER_LIMITS */
/* This will get compiled out on all 32-bit and better systems. */
else
if
(
PNG_SIZE_MAX
<
profile_length
)
return
png_icc_profile_error
(
png_ptr
,
colorspace
,
name
,
profile_length
,
"exceeds system limits"
);
# endif
/* !SET_USER_LIMITS */
return
1
;
}
#endif
/* READ_iCCP */
int
/* PRIVATE */
png_icc_check_header
(
png_const_structrp
png_ptr
,
png_colorspacerp
colorspace
,
png_const_charp
name
,
png_uint_32
profile_length
,
...
...
@@ -2377,7 +2411,7 @@ png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
if
((
colorspace
->
flags
&
PNG_COLORSPACE_INVALID
)
!=
0
)
return
0
;
if
(
png_
icc_check_length
(
png_ptr
,
colorspace
,
name
,
profile_length
)
!=
0
&&
if
(
icc_check_length
(
png_ptr
,
colorspace
,
name
,
profile_length
)
!=
0
&&
png_icc_check_header
(
png_ptr
,
colorspace
,
name
,
profile_length
,
profile
,
color_type
)
!=
0
&&
png_icc_check_tag_table
(
png_ptr
,
colorspace
,
name
,
profile_length
,
...
...
pngpriv.h
浏览文件 @
e018ab98
/* pngpriv.h - private declarations for use inside libpng
*
* Last changed in libpng 1.6.2
4 [August 4, 2016
]
* Last changed in libpng 1.6.2
5 [(PENDING RELEASE)
]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
...
...
@@ -1494,9 +1494,11 @@ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr,
/* The 'name' is used for information only */
/* Routines for checking parts of an ICC profile. */
#ifdef PNG_READ_iCCP_SUPPORTED
PNG_INTERNAL_FUNCTION
(
int
,
png_icc_check_length
,(
png_const_structrp
png_ptr
,
png_colorspacerp
colorspace
,
png_const_charp
name
,
png_uint_32
profile_length
),
PNG_EMPTY
);
#endif
/* READ_iCCP */
PNG_INTERNAL_FUNCTION
(
int
,
png_icc_check_header
,(
png_const_structrp
png_ptr
,
png_colorspacerp
colorspace
,
png_const_charp
name
,
png_uint_32
profile_length
,
...
...
pngtest.c
浏览文件 @
e018ab98
/* pngtest.c - a simple test program to test libpng
*
* Last changed in libpng 1.6.2
4 [August 4, 2016
]
* Last changed in libpng 1.6.2
5 [(PENDING RELEASE)
]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
...
...
@@ -514,10 +514,10 @@ typedef struct memory_information
typedef
memory_information
*
memory_infop
;
static
memory_infop
pinformation
=
NULL
;
static
in
t
current_allocation
=
0
;
static
in
t
maximum_allocation
=
0
;
static
in
t
total_allocation
=
0
;
static
in
t
num_allocations
=
0
;
static
png_alloc_size_
t
current_allocation
=
0
;
static
png_alloc_size_
t
maximum_allocation
=
0
;
static
png_alloc_size_
t
total_allocation
=
0
;
static
png_alloc_size_
t
num_allocations
=
0
;
png_voidp
PNGCBAPI
png_debug_malloc
PNGARG
((
png_structp
png_ptr
,
png_alloc_size_t
size
));
...
...
@@ -604,9 +604,10 @@ png_debug_free(png_structp png_ptr, png_voidp ptr)
if
(
pinfo
->
pointer
==
ptr
)
{
*
ppinfo
=
pinfo
->
next
;
current_allocation
-=
pinfo
->
size
;
if
(
current_allocation
<
0
)
if
(
current_allocation
<
pinfo
->
size
)
fprintf
(
STDERR
,
"Duplicate free of memory
\n
"
);
else
current_allocation
-=
pinfo
->
size
;
/* We must free the list element too, but first kill
the memory that is to be freed. */
memset
(
ptr
,
0x55
,
pinfo
->
size
);
...
...
@@ -938,6 +939,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
read_user_chunk_callback
);
#endif
#ifdef PNG_SET_USER_LIMITS_SUPPORTED
# ifdef CHUNK_LIMIT
/* from the build, for testing */
png_set_chunk_malloc_max
(
read_ptr
,
CHUNK_LIMIT
);
# endif
/* CHUNK_LIMIT */
#endif
#ifdef PNG_SETJMP_SUPPORTED
pngtest_debug
(
"Setting jmpbuf for read struct"
);
if
(
setjmp
(
png_jmpbuf
(
read_ptr
)))
...
...
@@ -1876,7 +1883,7 @@ main(int argc, char *argv[])
{
int
i
;
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
in
t
allocation_now
=
current_allocation
;
png_alloc_size_
t
allocation_now
=
current_allocation
;
#endif
for
(
i
=
2
;
i
<
argc
;
++
i
)
{
...
...
@@ -1909,15 +1916,15 @@ main(int argc, char *argv[])
}
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
if
(
allocation_now
!=
current_allocation
)
fprintf
(
STDERR
,
"MEMORY ERROR: %
d
bytes lost
\n
"
,
current_allocation
-
allocation_now
);
fprintf
(
STDERR
,
"MEMORY ERROR: %
lu
bytes lost
\n
"
,
(
unsigned
long
)(
current_allocation
-
allocation_now
)
);
if
(
current_allocation
!=
0
)
{
memory_infop
pinfo
=
pinformation
;
fprintf
(
STDERR
,
"MEMORY ERROR: %
d
bytes still allocated
\n
"
,
current_allocation
);
fprintf
(
STDERR
,
"MEMORY ERROR: %
lu
bytes still allocated
\n
"
,
(
unsigned
long
)
current_allocation
);
while
(
pinfo
!=
NULL
)
{
...
...
@@ -1930,14 +1937,14 @@ main(int argc, char *argv[])
#endif
}
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
fprintf
(
STDERR
,
" Current memory allocation: %
10d
bytes
\n
"
,
current_allocation
);
fprintf
(
STDERR
,
" Maximum memory allocation: %
10d
bytes
\n
"
,
maximum_allocation
);
fprintf
(
STDERR
,
" Total memory allocation: %
10d
bytes
\n
"
,
total_allocation
);
fprintf
(
STDERR
,
" Number of allocations: %
10d
\n
"
,
num_allocations
);
fprintf
(
STDERR
,
" Current memory allocation: %
20lu
bytes
\n
"
,
(
unsigned
long
)
current_allocation
);
fprintf
(
STDERR
,
" Maximum memory allocation: %
20lu
bytes
\n
"
,
(
unsigned
long
)
maximum_allocation
);
fprintf
(
STDERR
,
" Total memory allocation: %
20lu
bytes
\n
"
,
(
unsigned
long
)
total_allocation
);
fprintf
(
STDERR
,
" Number of allocations: %
20lu
\n
"
,
(
unsigned
long
)
num_allocations
);
#endif
}
...
...
@@ -1948,7 +1955,7 @@ main(int argc, char *argv[])
{
int
kerror
;
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
in
t
allocation_now
=
current_allocation
;
png_alloc_size_
t
allocation_now
=
current_allocation
;
#endif
if
(
i
==
1
)
status_dots_requested
=
1
;
...
...
@@ -1998,15 +2005,15 @@ main(int argc, char *argv[])
}
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
if
(
allocation_now
!=
current_allocation
)
fprintf
(
STDERR
,
"MEMORY ERROR: %
d
bytes lost
\n
"
,
current_allocation
-
allocation_now
);
fprintf
(
STDERR
,
"MEMORY ERROR: %
lu
bytes lost
\n
"
,
(
unsigned
long
)(
current_allocation
-
allocation_now
)
);
if
(
current_allocation
!=
0
)
{
memory_infop
pinfo
=
pinformation
;
fprintf
(
STDERR
,
"MEMORY ERROR: %
d
bytes still allocated
\n
"
,
current_allocation
);
fprintf
(
STDERR
,
"MEMORY ERROR: %
lu
bytes still allocated
\n
"
,
(
unsigned
long
)
current_allocation
);
while
(
pinfo
!=
NULL
)
{
...
...
@@ -2018,14 +2025,14 @@ main(int argc, char *argv[])
#endif
}
#if defined(PNG_USER_MEM_SUPPORTED) && PNG_DEBUG
fprintf
(
STDERR
,
" Current memory allocation: %
10d
bytes
\n
"
,
current_allocation
);
fprintf
(
STDERR
,
" Maximum memory allocation: %
10d
bytes
\n
"
,
maximum_allocation
);
fprintf
(
STDERR
,
" Total memory allocation: %
10d
bytes
\n
"
,
total_allocation
);
fprintf
(
STDERR
,
" Number of allocations: %
10d
\n
"
,
num_allocations
);
fprintf
(
STDERR
,
" Current memory allocation: %
20lu
bytes
\n
"
,
(
unsigned
long
)
current_allocation
);
fprintf
(
STDERR
,
" Maximum memory allocation: %
20lu
bytes
\n
"
,
(
unsigned
long
)
maximum_allocation
);
fprintf
(
STDERR
,
" Total memory allocation: %
20lu
bytes
\n
"
,
(
unsigned
long
)
total_allocation
);
fprintf
(
STDERR
,
" Number of allocations: %
20lu
\n
"
,
(
unsigned
long
)
num_allocations
);
#endif
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录