Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
76706563
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,体验更适合开发者的 AI 搜索 >>
提交
76706563
编写于
9月 03, 2015
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix some signed shifts that should have been unsigned for C spec reasons
上级
0e24ec5f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
7 addition
and
3 deletion
+7
-3
stb_vorbis.c
stb_vorbis.c
+7
-3
未找到文件。
stb_vorbis.c
浏览文件 @
76706563
...
...
@@ -36,6 +36,8 @@
//
// Partial history:
// 1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson)
// some crash fixes when out of memory or with corrupt files
// fix some inappropriately signed shifts
// 1.05 - 2015/04/19 - don't define __forceinline if it's redundant
// 1.04 - 2014/08/27 - fix missing const-correct case in API
// 1.03 - 2014/08/07 - warning fixes
...
...
@@ -934,7 +936,7 @@ static void crc32_init(void)
int
i
,
j
;
uint32
s
;
for
(
i
=
0
;
i
<
256
;
i
++
)
{
for
(
s
=
i
<<
24
,
j
=
0
;
j
<
8
;
++
j
)
for
(
s
=
(
uint32
)
i
<<
24
,
j
=
0
;
j
<
8
;
++
j
)
s
=
(
s
<<
1
)
^
(
s
>=
(
1U
<<
31
)
?
CRC32_POLY
:
0
);
crc_table
[
i
]
=
s
;
}
...
...
@@ -1035,7 +1037,7 @@ static int compute_codewords(Codebook *c, uint8 *len, int n, uint32 *values)
add_entry
(
c
,
0
,
k
,
m
++
,
len
[
k
],
values
);
// add all available leaves
for
(
i
=
1
;
i
<=
len
[
k
];
++
i
)
available
[
i
]
=
1
<<
(
32
-
i
);
available
[
i
]
=
1
U
<<
(
32
-
i
);
// note that the above code treats the first case specially,
// but it's really the same as the following code, so they
// could probably be combined (except the initial code is 0,
...
...
@@ -1564,7 +1566,7 @@ static __forceinline void prep_huffman(vorb *f)
if
(
f
->
last_seg
&&
!
f
->
bytes_in_seg
)
return
;
z
=
get8_packet_raw
(
f
);
if
(
z
==
EOP
)
return
;
f
->
acc
+=
z
<<
f
->
valid_bits
;
f
->
acc
+=
(
unsigned
)
z
<<
f
->
valid_bits
;
f
->
valid_bits
+=
8
;
}
while
(
f
->
valid_bits
<=
24
);
}
...
...
@@ -5383,6 +5385,8 @@ int stb_vorbis_get_samples_float(stb_vorbis *f, int channels, float **buffer, in
#endif // STB_VORBIS_NO_PULLDATA_API
/* Version history
1.06 - 2015/08/31 - full, correct support for seeking API (Dougall Johnson)
some crash fixes when out of memory or with corrupt files
1.05 - 2015/04/19 - don't define __forceinline if it's redundant
1.04 - 2014/08/27 - fix missing const-correct case in API
1.03 - 2014/08/07 - Warning fixes
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录