Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Libpng
提交
29fca795
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,发现更多精彩内容 >>
提交
29fca795
编写于
11月 19, 2011
作者:
G
Glenn Randers-Pehrson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[libpng15] Validate time settings passed to pngset()
and png_convert_to_rfc1123(). (Frank Busse).
上级
bd2fa5de
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
31 addition
and
9 deletion
+31
-9
ANNOUNCE
ANNOUNCE
+2
-1
CHANGES
CHANGES
+2
-0
png.c
png.c
+18
-8
pngset.c
pngset.c
+9
-0
未找到文件。
ANNOUNCE
浏览文件 @
29fca795
...
...
@@ -101,7 +101,8 @@ Version 1.5.7beta04 [November 17, 2011]
Version 1.5.7beta05 [November 19, 2011]
Removed "zTXt" from warning in generic chunk decompression function.
Validate time settings passed to pngset() and png_convert_to_rfc1123()
(Frank Busse).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net:
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
...
...
CHANGES
浏览文件 @
29fca795
...
...
@@ -3746,6 +3746,8 @@ Version 1.5.7beta04 [November 17, 2011]
Version 1.5.7beta05 [November 19, 2011]
Removed "zTXt" from warning in generic chunk decompression function.
Validate time settings passed to pngset() and png_convert_to_rfc1123()
(Frank Busse).
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
...
...
png.c
浏览文件 @
29fca795
...
...
@@ -599,9 +599,19 @@ png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime)
if
(
png_ptr
==
NULL
)
return
(
NULL
);
if
(
ptime
->
year
>
9999
||
/* RFC1123 limitation */
ptime
->
month
==
0
||
ptime
->
month
>
12
||
ptime
->
day
==
0
||
ptime
->
day
>
31
||
ptime
->
hour
>
23
||
ptime
->
minute
>
59
||
ptime
->
second
>
60
)
{
png_warning
(
png_ptr
,
"Ignoring invalid time value"
);
return
(
NULL
);
}
{
size_t
pos
=
0
;
char
number_buf
[
5
];
/* enough for a f
our
digit year */
char
number_buf
[
5
];
/* enough for a f
ive-
digit year */
# define APPEND_STRING(string)\
pos = png_safecat(png_ptr->time_buffer, sizeof png_ptr->time_buffer,\
...
...
@@ -612,17 +622,17 @@ png_convert_to_rfc1123(png_structp png_ptr, png_const_timep ptime)
if (pos < (sizeof png_ptr->time_buffer)-1)\
png_ptr->time_buffer[pos++] = (ch)
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_u
,
(
unsigned
)
ptime
->
day
%
32
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_u
,
(
unsigned
)
ptime
->
day
);
APPEND
(
' '
);
APPEND_STRING
(
short_months
[(
ptime
->
month
-
1
)
%
12
]);
APPEND_STRING
(
short_months
[(
ptime
->
month
-
1
)]);
APPEND
(
' '
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_u
,
ptime
->
year
);
APPEND
(
' '
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_02u
,
(
unsigned
)
ptime
->
hour
%
24
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_02u
,
(
unsigned
)
ptime
->
hour
);
APPEND
(
':'
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_02u
,
(
unsigned
)
ptime
->
minute
%
60
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_02u
,
(
unsigned
)
ptime
->
minute
);
APPEND
(
':'
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_02u
,
(
unsigned
)
ptime
->
second
%
61
);
APPEND_NUMBER
(
PNG_NUMBER_FORMAT_02u
,
(
unsigned
)
ptime
->
second
);
APPEND_STRING
(
" +0000"
);
/* This reliably terminates the buffer */
# undef APPEND
...
...
@@ -645,13 +655,13 @@ png_get_copyright(png_const_structp png_ptr)
#else
# ifdef __STDC__
return
PNG_STRING_NEWLINE
\
"libpng version 1.5.7beta05 - November 1
8
, 2011"
PNG_STRING_NEWLINE
\
"libpng version 1.5.7beta05 - November 1
9
, 2011"
PNG_STRING_NEWLINE
\
"Copyright (c) 1998-2011 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.5.7beta05 - November 1
8
, 2011\
return
"libpng version 1.5.7beta05 - November 1
9
, 2011\
Copyright (c) 1998-2011 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."
;
...
...
pngset.c
浏览文件 @
29fca795
...
...
@@ -864,6 +864,15 @@ png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_const_timep mod_time)
(
png_ptr
->
mode
&
PNG_WROTE_tIME
))
return
;
if
(
mod_time
->
month
==
0
||
mod_time
->
month
>
12
||
mod_time
->
day
==
0
||
mod_time
->
day
>
31
||
mod_time
->
hour
>
23
||
mod_time
->
minute
>
59
||
mod_time
->
second
>
60
)
{
png_warning
(
png_ptr
,
"Ignoring invalid time value"
);
return
;
}
png_memcpy
(
&
(
info_ptr
->
mod_time
),
mod_time
,
png_sizeof
(
png_time
));
info_ptr
->
valid
|=
PNG_INFO_tIME
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录