Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
B1ack1e
FFmpeg
提交
8c345581
F
FFmpeg
项目概览
B1ack1e
/
FFmpeg
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
FFmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
8c345581
编写于
5月 17, 2013
作者:
L
Luca Barbato
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wavpack: return meaningful errors
And forward those that were already meaningful.
上级
0f689a3d
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
16 addition
and
16 deletion
+16
-16
libavcodec/wavpack.c
libavcodec/wavpack.c
+16
-16
未找到文件。
libavcodec/wavpack.c
浏览文件 @
8c345581
...
...
@@ -777,14 +777,14 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
if
(
block_no
>=
wc
->
fdec_num
&&
wv_alloc_frame_context
(
wc
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error creating frame decode context
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
s
=
wc
->
fdec
[
block_no
];
if
(
!
s
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Context for block %d is not present
\n
"
,
block_no
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
memset
(
s
->
decorr
,
0
,
MAX_TERMS
*
sizeof
(
Decorr
));
...
...
@@ -1040,7 +1040,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
if
(
size
<=
1
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Insufficient channel information
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
chan
=
*
buf
++
;
switch
(
size
-
2
)
{
...
...
@@ -1071,7 +1071,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
"Block reports total %d channels, "
"decoder believes it's %d channels
\n
"
,
chan
,
avctx
->
channels
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
!
avctx
->
channel_layout
)
avctx
->
channel_layout
=
chmask
;
...
...
@@ -1086,31 +1086,31 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
if
(
!
got_terms
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"No block with decorrelation terms
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
!
got_weights
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"No block with decorrelation weights
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
!
got_samples
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"No block with decorrelation samples
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
!
got_entropy
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"No block with entropy info
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
s
->
hybrid
&&
!
got_hybrid
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Hybrid config not found
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
!
got_bs
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Packed samples not found
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
!
got_float
&&
avctx
->
sample_fmt
==
AV_SAMPLE_FMT_FLT
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Float information not found
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
(
s
->
got_extra_bits
&&
avctx
->
sample_fmt
!=
AV_SAMPLE_FMT_FLT
)
{
const
int
size
=
get_bits_left
(
&
s
->
gb_extra_bits
);
...
...
@@ -1130,7 +1130,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
samplecount
=
wv_unpack_stereo
(
s
,
&
s
->
gb
,
samples
,
AV_SAMPLE_FMT_FLT
);
if
(
samplecount
<
0
)
return
-
1
;
return
samplecount
;
samplecount
>>=
1
;
}
else
{
...
...
@@ -1144,7 +1144,7 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
samplecount
=
wv_unpack_mono
(
s
,
&
s
->
gb
,
samples
,
AV_SAMPLE_FMT_FLT
);
if
(
samplecount
<
0
)
return
-
1
;
return
samplecount
;
if
(
s
->
stereo
&&
avctx
->
sample_fmt
==
AV_SAMPLE_FMT_S16
)
{
int16_t
*
dst
=
(
int16_t
*
)
samples
+
1
;
...
...
@@ -1220,7 +1220,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
if
(
s
->
samples
<=
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid number of samples: %d
\n
"
,
s
->
samples
);
return
AVERROR
(
EINVAL
)
;
return
AVERROR
_INVALIDDATA
;
}
if
(
frame_flags
&
0x80
)
{
...
...
@@ -1258,13 +1258,13 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
"Block %d has invalid size (size %d vs. %d bytes left)
\n
"
,
s
->
block
,
frame_size
,
buf_size
);
wavpack_decode_flush
(
avctx
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
if
((
samplecount
=
wavpack_decode_block
(
avctx
,
s
->
block
,
frame
->
data
[
0
],
got_frame_ptr
,
buf
,
frame_size
))
<
0
)
{
wavpack_decode_flush
(
avctx
);
return
-
1
;
return
samplecount
;
}
s
->
block
++
;
buf
+=
frame_size
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录