Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
a96f51f2
Commit
a96f51f2
authored
Sep 22, 2014
by
Diego Biurrun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dca: Return more informative error codes
parent
b339019d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
dca_exss.c
libavcodec/dca_exss.c
+6
-6
No files found.
libavcodec/dca_exss.c
View file @
a96f51f2
...
@@ -95,7 +95,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
...
@@ -95,7 +95,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
int
i
,
j
;
int
i
,
j
;
if
(
get_bits_left
(
&
s
->
gb
)
<
16
)
if
(
get_bits_left
(
&
s
->
gb
)
<
16
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
/* We will parse just enough to get to the extensions bitmask with which
/* We will parse just enough to get to the extensions bitmask with which
* we can set the profile value. */
* we can set the profile value. */
...
@@ -114,7 +114,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
...
@@ -114,7 +114,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
* for the asset header size field above was 512 bytes? */
* for the asset header size field above was 512 bytes? */
int
text_length
=
get_bits
(
&
s
->
gb
,
10
)
+
1
;
int
text_length
=
get_bits
(
&
s
->
gb
,
10
)
+
1
;
if
(
get_bits_left
(
&
s
->
gb
)
<
text_length
*
8
)
if
(
get_bits_left
(
&
s
->
gb
)
<
text_length
*
8
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
skip_bits_long
(
&
s
->
gb
,
text_length
*
8
);
// info text
skip_bits_long
(
&
s
->
gb
,
text_length
*
8
);
// info text
}
}
...
@@ -147,7 +147,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
...
@@ -147,7 +147,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
for
(
i
=
0
;
i
<
spkr_remap_sets
;
i
++
)
{
for
(
i
=
0
;
i
<
spkr_remap_sets
;
i
++
)
{
int
num_dec_ch_remaps
=
get_bits
(
&
s
->
gb
,
5
)
+
1
;
int
num_dec_ch_remaps
=
get_bits
(
&
s
->
gb
,
5
)
+
1
;
if
(
get_bits_left
(
&
s
->
gb
)
<
0
)
if
(
get_bits_left
(
&
s
->
gb
)
<
0
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
for
(
j
=
0
;
j
<
num_spkrs
[
i
];
j
++
)
{
for
(
j
=
0
;
j
<
num_spkrs
[
i
];
j
++
)
{
int
remap_dec_ch_mask
=
get_bits_long
(
&
s
->
gb
,
num_dec_ch_remaps
);
int
remap_dec_ch_mask
=
get_bits_long
(
&
s
->
gb
,
num_dec_ch_remaps
);
...
@@ -187,7 +187,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
...
@@ -187,7 +187,7 @@ static int dca_exss_parse_asset_header(DCAContext *s)
for
(
i
=
0
;
i
<
s
->
num_mix_configs
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
num_mix_configs
;
i
++
)
{
if
(
get_bits_left
(
&
s
->
gb
)
<
0
)
if
(
get_bits_left
(
&
s
->
gb
)
<
0
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
dca_exss_skip_mix_coeffs
(
&
s
->
gb
,
channels
,
s
->
mix_config_num_ch
[
i
]);
dca_exss_skip_mix_coeffs
(
&
s
->
gb
,
channels
,
s
->
mix_config_num_ch
[
i
]);
if
(
embedded_6ch
)
if
(
embedded_6ch
)
dca_exss_skip_mix_coeffs
(
&
s
->
gb
,
6
,
s
->
mix_config_num_ch
[
i
]);
dca_exss_skip_mix_coeffs
(
&
s
->
gb
,
6
,
s
->
mix_config_num_ch
[
i
]);
...
@@ -214,11 +214,11 @@ static int dca_exss_parse_asset_header(DCAContext *s)
...
@@ -214,11 +214,11 @@ static int dca_exss_parse_asset_header(DCAContext *s)
/* not parsed further, we were only interested in the extensions mask */
/* not parsed further, we were only interested in the extensions mask */
if
(
get_bits_left
(
&
s
->
gb
)
<
0
)
if
(
get_bits_left
(
&
s
->
gb
)
<
0
)
return
-
1
;
return
AVERROR_INVALIDDATA
;
if
(
get_bits_count
(
&
s
->
gb
)
-
header_pos
>
header_size
*
8
)
{
if
(
get_bits_count
(
&
s
->
gb
)
-
header_pos
>
header_size
*
8
)
{
av_log
(
s
->
avctx
,
AV_LOG_WARNING
,
"Asset header size mismatch.
\n
"
);
av_log
(
s
->
avctx
,
AV_LOG_WARNING
,
"Asset header size mismatch.
\n
"
);
return
-
1
;
return
AVERROR_INVALIDDATA
;
}
}
skip_bits_long
(
&
s
->
gb
,
header_pos
+
header_size
*
8
-
get_bits_count
(
&
s
->
gb
));
skip_bits_long
(
&
s
->
gb
,
header_pos
+
header_size
*
8
-
get_bits_count
(
&
s
->
gb
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment