Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
931e8b66
提交
931e8b66
authored
3月 05, 2016
作者:
Seven Du
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-8905 #comment fix possible out of boundary access, please test
上级
f0c76fab
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
12 行增加
和
12 行删除
+12
-12
switch_core_video.c
src/switch_core_video.c
+12
-12
没有找到文件。
src/switch_core_video.c
浏览文件 @
931e8b66
...
...
@@ -358,8 +358,8 @@ SWITCH_DECLARE(void) switch_img_patch(switch_image_t *IMG, switch_image_t *img,
len
/=
2
;
for
(
i
=
y
;
i
<
max_h
;
i
+=
2
)
{
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
i
/
2
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
(
i
-
y
+
yoff
)
/
2
+
xoff
/
2
,
len
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
i
/
2
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
(
i
-
y
+
yoff
)
/
2
+
xoff
/
2
,
len
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
(
i
/
2
)
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
((
i
-
y
+
yoff
)
/
2
)
+
xoff
/
2
,
len
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
(
i
/
2
)
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
((
i
-
y
+
yoff
)
/
2
)
+
xoff
/
2
,
len
);
}
}
...
...
@@ -529,8 +529,8 @@ SWITCH_DECLARE(void) switch_img_fill(switch_image_t *img, int x, int y, int w, i
len
/=
2
;
for
(
i
=
y
;
i
<
max_h
;
i
+=
2
)
{
memset
(
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
i
/
2
+
x
/
2
,
yuv_color
.
u
,
len
);
memset
(
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
i
/
2
+
x
/
2
,
yuv_color
.
v
,
len
);
memset
(
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
(
i
/
2
)
+
x
/
2
,
yuv_color
.
u
,
len
);
memset
(
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
(
i
/
2
)
+
x
/
2
,
yuv_color
.
v
,
len
);
}
}
else
if
(
img
->
fmt
==
SWITCH_IMG_FMT_ARGB
)
{
for
(
i
=
0
;
i
<
img
->
d_w
;
i
++
)
{
...
...
@@ -555,8 +555,8 @@ static inline void switch_img_get_yuv_pixel(switch_image_t *img, switch_yuv_colo
if
(
x
<
0
||
y
<
0
||
x
>=
img
->
d_w
||
y
>=
img
->
d_h
)
return
;
yuv
->
y
=
*
(
img
->
planes
[
SWITCH_PLANE_Y
]
+
img
->
stride
[
SWITCH_PLANE_Y
]
*
y
+
x
);
yuv
->
u
=
*
(
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
y
/
2
+
x
/
2
);
yuv
->
v
=
*
(
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
y
/
2
+
x
/
2
);
yuv
->
u
=
*
(
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
(
y
/
2
)
+
x
/
2
);
yuv
->
v
=
*
(
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
(
y
/
2
)
+
x
/
2
);
}
#endif
...
...
@@ -1203,14 +1203,14 @@ SWITCH_DECLARE(void) switch_img_patch_hole(switch_image_t *IMG, switch_image_t *
int
size
=
rect
->
x
>
x
?
rect
->
x
-
x
:
0
;
size
/=
2
;
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
i
/
2
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
(
i
-
y
)
/
2
,
size
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
i
/
2
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
(
i
-
y
)
/
2
,
size
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
(
i
/
2
)
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
((
i
-
y
)
/
2
)
,
size
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
(
i
/
2
)
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
((
i
-
y
)
/
2
)
,
size
);
size
=
MIN
(
img
->
d_w
-
rect
->
w
-
size
,
IMG
->
d_w
-
(
rect
->
x
+
rect
->
w
))
/
2
;
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
i
/
2
+
(
rect
->
x
+
rect
->
w
)
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
(
i
-
y
)
/
2
+
(
rect
->
w
+
(
rect
->
x
-
x
))
/
2
,
size
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
i
/
2
+
(
rect
->
x
+
rect
->
w
)
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
(
i
-
y
)
/
2
+
(
rect
->
w
+
(
rect
->
x
-
x
))
/
2
,
size
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
(
i
/
2
)
+
(
rect
->
x
+
rect
->
w
)
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
((
i
-
y
)
/
2
)
+
(
rect
->
w
+
(
rect
->
x
-
x
))
/
2
,
size
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
(
i
/
2
)
+
(
rect
->
x
+
rect
->
w
)
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
((
i
-
y
)
/
2
)
+
(
rect
->
w
+
(
rect
->
x
-
x
))
/
2
,
size
);
}
else
{
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
i
/
2
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
(
i
-
y
)
/
2
,
len
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
i
/
2
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
(
i
-
y
)
/
2
,
len
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_U
]
+
IMG
->
stride
[
SWITCH_PLANE_U
]
*
(
i
/
2
)
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_U
]
+
img
->
stride
[
SWITCH_PLANE_U
]
*
((
i
-
y
)
/
2
)
,
len
);
memcpy
(
IMG
->
planes
[
SWITCH_PLANE_V
]
+
IMG
->
stride
[
SWITCH_PLANE_V
]
*
(
i
/
2
)
+
x
/
2
,
img
->
planes
[
SWITCH_PLANE_V
]
+
img
->
stride
[
SWITCH_PLANE_V
]
*
((
i
-
y
)
/
2
)
,
len
);
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论