Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
73953df7
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
73953df7
编写于
6月 20, 2014
作者:
D
Diego Biurrun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Replace av_malloc() and memset(0) by av_mallocz()
上级
f83896ab
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
4 addition
and
9 deletion
+4
-9
libavformat/matroskadec.c
libavformat/matroskadec.c
+1
-3
libavformat/rmdec.c
libavformat/rmdec.c
+1
-2
libavformat/utils.c
libavformat/utils.c
+2
-4
未找到文件。
libavformat/matroskadec.c
浏览文件 @
73953df7
...
...
@@ -746,11 +746,9 @@ static int ebml_read_ascii(AVIOContext *pb, int size, char **str)
static
int
ebml_read_binary
(
AVIOContext
*
pb
,
int
length
,
EbmlBin
*
bin
)
{
av_free
(
bin
->
data
);
if
(
!
(
bin
->
data
=
av_malloc
(
length
+
FF_INPUT_BUFFER_PADDING_SIZE
)))
if
(
!
(
bin
->
data
=
av_malloc
z
(
length
+
FF_INPUT_BUFFER_PADDING_SIZE
)))
return
AVERROR
(
ENOMEM
);
memset
(
bin
->
data
+
length
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
bin
->
size
=
length
;
bin
->
pos
=
avio_tell
(
pb
);
if
(
avio_read
(
pb
,
bin
->
data
,
length
)
!=
length
)
{
...
...
libavformat/rmdec.c
浏览文件 @
73953df7
...
...
@@ -86,11 +86,10 @@ static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned si
{
if
(
size
>=
1
<<
24
)
return
-
1
;
avctx
->
extradata
=
av_malloc
(
size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
avctx
->
extradata
=
av_malloc
z
(
size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
!
avctx
->
extradata
)
return
AVERROR
(
ENOMEM
);
avctx
->
extradata_size
=
avio_read
(
pb
,
avctx
->
extradata
,
size
);
memset
(
avctx
->
extradata
+
avctx
->
extradata_size
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
avctx
->
extradata_size
!=
size
)
return
AVERROR
(
EIO
);
return
0
;
...
...
libavformat/utils.c
浏览文件 @
73953df7
...
...
@@ -2381,14 +2381,12 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
int
i
=
st
->
parser
->
parser
->
split
(
st
->
codec
,
pkt
->
data
,
pkt
->
size
);
if
(
i
>
0
&&
i
<
FF_MAX_EXTRADATA_SIZE
)
{
st
->
codec
->
extradata_size
=
i
;
st
->
codec
->
extradata
=
av_malloc
(
st
->
codec
->
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
st
->
codec
->
extradata
=
av_malloc
z
(
st
->
codec
->
extradata_size
+
FF_INPUT_BUFFER_PADDING_SIZE
);
if
(
!
st
->
codec
->
extradata
)
return
AVERROR
(
ENOMEM
);
memcpy
(
st
->
codec
->
extradata
,
pkt
->
data
,
st
->
codec
->
extradata_size
);
memset
(
st
->
codec
->
extradata
+
i
,
0
,
FF_INPUT_BUFFER_PADDING_SIZE
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录