Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
M
mediasoup
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
聂卓夫
mediasoup
Commits
46ae2eaf
提交
46ae2eaf
authored
1月 13, 2019
作者:
Iñaki Baz Castillo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
RtpPacket: Fix Two-Byte header extensions parsing
上级
5b6cad15
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
9 行增加
和
10 行删除
+9
-10
RtpPacket.hpp
worker/include/RTC/RtpPacket.hpp
+0
-5
RtpPacket.cpp
worker/src/RTC/RtpPacket.cpp
+9
-5
没有找到文件。
worker/include/RTC/RtpPacket.hpp
浏览文件 @
46ae2eaf
...
@@ -67,13 +67,8 @@ namespace RTC
...
@@ -67,13 +67,8 @@ namespace RTC
/* Struct for Two-Bytes extension. */
/* Struct for Two-Bytes extension. */
struct
TwoBytesExtension
struct
TwoBytesExtension
{
{
#if defined(MS_LITTLE_ENDIAN)
uint8_t
len
:
8
;
uint8_t
id
:
8
;
#elif defined(MS_BIG_ENDIAN)
uint8_t
id
:
8
;
uint8_t
id
:
8
;
uint8_t
len
:
8
;
uint8_t
len
:
8
;
#endif
uint8_t
value
[
1
];
uint8_t
value
[
1
];
};
};
...
...
worker/src/RTC/RtpPacket.cpp
浏览文件 @
46ae2eaf
...
@@ -547,7 +547,7 @@ namespace RTC
...
@@ -547,7 +547,7 @@ namespace RTC
if
(
id
!=
0u
)
if
(
id
!=
0u
)
this
->
oneByteExtensions
[
id
]
=
reinterpret_cast
<
OneByteExtension
*>
(
ptr
);
this
->
oneByteExtensions
[
id
]
=
reinterpret_cast
<
OneByteExtension
*>
(
ptr
);
ptr
+=
1
+
len
;
ptr
+=
(
1
+
len
)
;
// Counting padding bytes.
// Counting padding bytes.
while
((
ptr
<
extensionEnd
)
&&
(
*
ptr
==
0
))
while
((
ptr
<
extensionEnd
)
&&
(
*
ptr
==
0
))
...
@@ -564,12 +564,16 @@ namespace RTC
...
@@ -564,12 +564,16 @@ namespace RTC
uint8_t
*
extensionEnd
=
extensionStart
+
GetExtensionHeaderLength
();
uint8_t
*
extensionEnd
=
extensionStart
+
GetExtensionHeaderLength
();
uint8_t
*
ptr
=
extensionStart
;
uint8_t
*
ptr
=
extensionStart
;
// ptr points to the ID field (1 byte).
// ptr+1 points to the length field (1 byte, can have value 0).
// Two-Byte extensions can have length 0.
while
(
ptr
+
1
<
extensionEnd
)
while
(
ptr
+
1
<
extensionEnd
)
{
{
uint8_t
id
=
*
ptr
;
uint8_t
id
=
*
ptr
;
size_t
len
=
*
(
++
ptr
);
uint8_t
len
=
*
(
ptr
+
1
);
if
(
ptr
+
len
>
extensionEnd
)
if
(
ptr
+
2
+
len
>
extensionEnd
)
{
{
MS_WARN_TAG
(
MS_WARN_TAG
(
rtp
,
"not enough space for the announced Two-Bytes header extension element value"
);
rtp
,
"not enough space for the announced Two-Bytes header extension element value"
);
...
@@ -581,7 +585,7 @@ namespace RTC
...
@@ -581,7 +585,7 @@ namespace RTC
if
(
id
!=
0u
)
if
(
id
!=
0u
)
this
->
twoBytesExtensions
[
id
]
=
reinterpret_cast
<
TwoBytesExtension
*>
(
ptr
);
this
->
twoBytesExtensions
[
id
]
=
reinterpret_cast
<
TwoBytesExtension
*>
(
ptr
);
ptr
+=
len
;
ptr
+=
(
2
+
len
)
;
// Counting padding bytes.
// Counting padding bytes.
while
((
ptr
<
extensionEnd
)
&&
(
*
ptr
==
0
))
while
((
ptr
<
extensionEnd
)
&&
(
*
ptr
==
0
))
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论