Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
90e8658d
S
stb
项目概览
itdan3344
/
stb
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
stb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
90e8658d
编写于
3月 18, 2017
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'fix_stbimage_pnm_load' of
https://github.com/rygorous/stb
into working
上级
d9e7c55b
22c72a06
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
10 deletion
+28
-10
stb_image.h
stb_image.h
+28
-10
未找到文件。
stb_image.h
浏览文件 @
90e8658d
...
...
@@ -5965,9 +5965,11 @@ static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *c
static
void
*
stbi__pic_load
(
stbi__context
*
s
,
int
*
px
,
int
*
py
,
int
*
comp
,
int
req_comp
,
stbi__result_info
*
ri
)
{
stbi_uc
*
result
;
int
i
,
x
,
y
;
int
i
,
x
,
y
,
internal_comp
;
STBI_NOTUSED
(
ri
);
if
(
!
comp
)
comp
=
&
internal_comp
;
for
(
i
=
0
;
i
<
92
;
++
i
)
stbi__get8
(
s
);
...
...
@@ -6586,6 +6588,11 @@ static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
char
buffer
[
STBI__HDR_BUFLEN
];
char
*
token
;
int
valid
=
0
;
int
dummy
;
if
(
!
x
)
x
=
&
dummy
;
if
(
!
y
)
y
=
&
dummy
;
if
(
!
comp
)
comp
=
&
dummy
;
if
(
stbi__hdr_test
(
s
)
==
0
)
{
stbi__rewind
(
s
);
...
...
@@ -6632,9 +6639,9 @@ static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
stbi__rewind
(
s
);
if
(
p
==
NULL
)
return
0
;
*
x
=
s
->
img_x
;
*
y
=
s
->
img_y
;
*
comp
=
info
.
ma
?
4
:
3
;
if
(
x
)
*
x
=
s
->
img_x
;
if
(
y
)
*
y
=
s
->
img_y
;
if
(
comp
)
*
comp
=
info
.
ma
?
4
:
3
;
return
1
;
}
#endif
...
...
@@ -6642,7 +6649,10 @@ static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
#ifndef STBI_NO_PSD
static
int
stbi__psd_info
(
stbi__context
*
s
,
int
*
x
,
int
*
y
,
int
*
comp
)
{
int
channelCount
;
int
channelCount
,
dummy
;
if
(
!
x
)
x
=
&
dummy
;
if
(
!
y
)
y
=
&
dummy
;
if
(
!
comp
)
comp
=
&
dummy
;
if
(
stbi__get32be
(
s
)
!=
0x38425053
)
{
stbi__rewind
(
s
);
return
0
;
...
...
@@ -6675,9 +6685,13 @@ static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
#ifndef STBI_NO_PIC
static
int
stbi__pic_info
(
stbi__context
*
s
,
int
*
x
,
int
*
y
,
int
*
comp
)
{
int
act_comp
=
0
,
num_packets
=
0
,
chained
;
int
act_comp
=
0
,
num_packets
=
0
,
chained
,
dummy
;
stbi__pic_packet
packets
[
10
];
if
(
!
x
)
x
=
&
dummy
;
if
(
!
y
)
y
=
&
dummy
;
if
(
!
comp
)
comp
=
&
dummy
;
if
(
!
stbi__pic_is4
(
s
,
"
\x53\x80\xF6\x34
"
))
{
stbi__rewind
(
s
);
return
0
;
...
...
@@ -6763,7 +6777,7 @@ static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req
*
x
=
s
->
img_x
;
*
y
=
s
->
img_y
;
*
comp
=
s
->
img_n
;
if
(
comp
)
*
comp
=
s
->
img_n
;
if
(
!
stbi__mad3sizes_valid
(
s
->
img_n
,
s
->
img_x
,
s
->
img_y
,
0
))
return
stbi__errpuc
(
"too large"
,
"PNM too large"
);
...
...
@@ -6817,16 +6831,20 @@ static int stbi__pnm_getinteger(stbi__context *s, char *c)
static
int
stbi__pnm_info
(
stbi__context
*
s
,
int
*
x
,
int
*
y
,
int
*
comp
)
{
int
maxv
;
int
maxv
,
dummy
;
char
c
,
p
,
t
;
stbi__rewind
(
s
);
if
(
!
x
)
x
=
&
dummy
;
if
(
!
y
)
y
=
&
dummy
;
if
(
!
comp
)
comp
=
&
dummy
;
stbi__rewind
(
s
);
// Get identifier
p
=
(
char
)
stbi__get8
(
s
);
t
=
(
char
)
stbi__get8
(
s
);
if
(
p
!=
'P'
||
(
t
!=
'5'
&&
t
!=
'6'
))
{
stbi__rewind
(
s
);
stbi__rewind
(
s
);
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录