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
052e692e
Commit
052e692e
authored
Dec 24, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/ac3dec: Print the value of out of range exponents
Signed-off-by:
Michael Niedermayer
<
michael@niedermayer.cc
>
parent
26937fb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
ac3dec.c
libavcodec/ac3dec.c
+6
-4
No files found.
libavcodec/ac3dec.c
View file @
052e692e
...
@@ -411,7 +411,8 @@ static void set_downmix_coeffs(AC3DecodeContext *s)
...
@@ -411,7 +411,8 @@ static void set_downmix_coeffs(AC3DecodeContext *s)
* Decode the grouped exponents according to exponent strategy.
* Decode the grouped exponents according to exponent strategy.
* reference: Section 7.1.3 Exponent Decoding
* reference: Section 7.1.3 Exponent Decoding
*/
*/
static
int
decode_exponents
(
GetBitContext
*
gbc
,
int
exp_strategy
,
int
ngrps
,
static
int
decode_exponents
(
AC3DecodeContext
*
s
,
GetBitContext
*
gbc
,
int
exp_strategy
,
int
ngrps
,
uint8_t
absexp
,
int8_t
*
dexps
)
uint8_t
absexp
,
int8_t
*
dexps
)
{
{
int
i
,
j
,
grp
,
group_size
;
int
i
,
j
,
grp
,
group_size
;
...
@@ -431,8 +432,10 @@ static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,
...
@@ -431,8 +432,10 @@ static int decode_exponents(GetBitContext *gbc, int exp_strategy, int ngrps,
prevexp
=
absexp
;
prevexp
=
absexp
;
for
(
i
=
0
,
j
=
0
;
i
<
ngrps
*
3
;
i
++
)
{
for
(
i
=
0
,
j
=
0
;
i
<
ngrps
*
3
;
i
++
)
{
prevexp
+=
dexp
[
i
]
-
2
;
prevexp
+=
dexp
[
i
]
-
2
;
if
(
prevexp
>
24U
)
if
(
prevexp
>
24U
)
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"exponent %d is out-of-range
\n
"
,
prevexp
);
return
-
1
;
return
-
1
;
}
switch
(
group_size
)
{
switch
(
group_size
)
{
case
4
:
dexps
[
j
++
]
=
prevexp
;
case
4
:
dexps
[
j
++
]
=
prevexp
;
dexps
[
j
++
]
=
prevexp
;
dexps
[
j
++
]
=
prevexp
;
...
@@ -1141,10 +1144,9 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
...
@@ -1141,10 +1144,9 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
for
(
ch
=
!
cpl_in_use
;
ch
<=
s
->
channels
;
ch
++
)
{
for
(
ch
=
!
cpl_in_use
;
ch
<=
s
->
channels
;
ch
++
)
{
if
(
s
->
exp_strategy
[
blk
][
ch
]
!=
EXP_REUSE
)
{
if
(
s
->
exp_strategy
[
blk
][
ch
]
!=
EXP_REUSE
)
{
s
->
dexps
[
ch
][
0
]
=
get_bits
(
gbc
,
4
)
<<
!
ch
;
s
->
dexps
[
ch
][
0
]
=
get_bits
(
gbc
,
4
)
<<
!
ch
;
if
(
decode_exponents
(
gbc
,
s
->
exp_strategy
[
blk
][
ch
],
if
(
decode_exponents
(
s
,
gbc
,
s
->
exp_strategy
[
blk
][
ch
],
s
->
num_exp_groups
[
ch
],
s
->
dexps
[
ch
][
0
],
s
->
num_exp_groups
[
ch
],
s
->
dexps
[
ch
][
0
],
&
s
->
dexps
[
ch
][
s
->
start_freq
[
ch
]
+!!
ch
]))
{
&
s
->
dexps
[
ch
][
s
->
start_freq
[
ch
]
+!!
ch
]))
{
av_log
(
s
->
avctx
,
AV_LOG_ERROR
,
"exponent out-of-range
\n
"
);
return
AVERROR_INVALIDDATA
;
return
AVERROR_INVALIDDATA
;
}
}
if
(
ch
!=
CPL_CH
&&
ch
!=
s
->
lfe_ch
)
if
(
ch
!=
CPL_CH
&&
ch
!=
s
->
lfe_ch
)
...
...
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