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
a10c4ce2
Commit
a10c4ce2
authored
Aug 04, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aac: Forward errors properly in aac_decode_frame_int
Incidentally also remove a warning.
parent
71953ebc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
aacdec.c
libavcodec/aacdec.c
+17
-17
No files found.
libavcodec/aacdec.c
View file @
a10c4ce2
...
...
@@ -2427,7 +2427,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
int
size
;
AACADTSHeaderInfo
hdr_info
;
uint8_t
layout_map
[
MAX_ELEM_ID
*
4
][
3
];
int
layout_map_tags
;
int
layout_map_tags
,
ret
;
size
=
avpriv_aac_parse_header
(
gb
,
&
hdr_info
);
if
(
size
>
0
)
{
...
...
@@ -2439,12 +2439,15 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
push_output_configuration
(
ac
);
if
(
hdr_info
.
chan_config
)
{
ac
->
oc
[
1
].
m4ac
.
chan_config
=
hdr_info
.
chan_config
;
if
(
set_default_channel_config
(
ac
->
avctx
,
layout_map
,
&
layout_map_tags
,
hdr_info
.
chan_config
))
return
-
7
;
if
(
output_configure
(
ac
,
layout_map
,
layout_map_tags
,
FFMAX
(
ac
->
oc
[
1
].
status
,
OC_TRIAL_FRAME
),
0
))
return
-
7
;
if
((
ret
=
set_default_channel_config
(
ac
->
avctx
,
layout_map
,
&
layout_map_tags
,
hdr_info
.
chan_config
))
<
0
)
return
ret
;
if
((
ret
=
output_configure
(
ac
,
layout_map
,
layout_map_tags
,
FFMAX
(
ac
->
oc
[
1
].
status
,
OC_TRIAL_FRAME
),
0
))
<
0
)
return
ret
;
}
else
{
ac
->
oc
[
1
].
m4ac
.
chan_config
=
0
;
}
...
...
@@ -2475,22 +2478,19 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
ac
->
frame
=
data
;
if
(
show_bits
(
gb
,
12
)
==
0xfff
)
{
if
(
parse_adts_frame_header
(
ac
,
gb
)
<
0
)
{
if
(
(
err
=
parse_adts_frame_header
(
ac
,
gb
)
)
<
0
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error decoding AAC frame header.
\n
"
);
err
=
-
1
;
goto
fail
;
}
if
(
ac
->
oc
[
1
].
m4ac
.
sampling_index
>
12
)
{
av_log
(
ac
->
avctx
,
AV_LOG_ERROR
,
"invalid sampling rate index %d
\n
"
,
ac
->
oc
[
1
].
m4ac
.
sampling_index
);
err
=
-
1
;
err
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
}
if
(
frame_configure_elements
(
avctx
)
<
0
)
{
err
=
-
1
;
if
((
err
=
frame_configure_elements
(
avctx
))
<
0
)
goto
fail
;
}
ac
->
tags_mapped
=
0
;
// parse
...
...
@@ -2501,7 +2501,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if
(
!
(
che
=
get_che
(
ac
,
elem_type
,
elem_id
)))
{
av_log
(
ac
->
avctx
,
AV_LOG_ERROR
,
"channel element %d.%d is not allocated
\n
"
,
elem_type
,
elem_id
);
err
=
-
1
;
err
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
samples
=
1024
;
...
...
@@ -2557,7 +2557,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
elem_id
+=
get_bits
(
gb
,
8
)
-
1
;
if
(
get_bits_left
(
gb
)
<
8
*
elem_id
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
overread_err
);
err
=
-
1
;
err
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
while
(
elem_id
>
0
)
...
...
@@ -2566,7 +2566,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
break
;
default:
err
=
-
1
;
/* should not happen, but keeps compiler happy */
err
=
AVERROR_BUG
;
/* should not happen, but keeps compiler happy */
break
;
}
...
...
@@ -2578,7 +2578,7 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
if
(
get_bits_left
(
gb
)
<
3
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
overread_err
);
err
=
-
1
;
err
=
AVERROR_INVALIDDATA
;
goto
fail
;
}
}
...
...
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