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
6dc7dd7a
Commit
6dc7dd7a
authored
Oct 28, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac1: check for ff_mdct_init() failure
parent
21dcecc3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
15 deletions
+22
-15
atrac1.c
libavcodec/atrac1.c
+22
-15
No files found.
libavcodec/atrac1.c
View file @
6dc7dd7a
...
...
@@ -326,9 +326,24 @@ static int atrac1_decode_frame(AVCodecContext *avctx, void *data,
}
static
av_cold
int
atrac1_decode_end
(
AVCodecContext
*
avctx
)
{
AT1Ctx
*
q
=
avctx
->
priv_data
;
av_freep
(
&
q
->
out_samples
[
0
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
0
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
1
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
2
]);
return
0
;
}
static
av_cold
int
atrac1_decode_init
(
AVCodecContext
*
avctx
)
{
AT1Ctx
*
q
=
avctx
->
priv_data
;
int
ret
;
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLT
;
...
...
@@ -349,9 +364,13 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
}
/* Init the mdct transforms */
ff_mdct_init
(
&
q
->
mdct_ctx
[
0
],
6
,
1
,
-
1
.
0
/
(
1
<<
15
));
ff_mdct_init
(
&
q
->
mdct_ctx
[
1
],
8
,
1
,
-
1
.
0
/
(
1
<<
15
));
ff_mdct_init
(
&
q
->
mdct_ctx
[
2
],
9
,
1
,
-
1
.
0
/
(
1
<<
15
));
if
((
ret
=
ff_mdct_init
(
&
q
->
mdct_ctx
[
0
],
6
,
1
,
-
1
.
0
/
(
1
<<
15
)))
||
(
ret
=
ff_mdct_init
(
&
q
->
mdct_ctx
[
1
],
8
,
1
,
-
1
.
0
/
(
1
<<
15
)))
||
(
ret
=
ff_mdct_init
(
&
q
->
mdct_ctx
[
2
],
9
,
1
,
-
1
.
0
/
(
1
<<
15
))))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error initializing MDCT
\n
"
);
atrac1_decode_end
(
avctx
);
return
ret
;
}
ff_init_ff_sine_windows
(
5
);
...
...
@@ -374,18 +393,6 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
}
static
av_cold
int
atrac1_decode_end
(
AVCodecContext
*
avctx
)
{
AT1Ctx
*
q
=
avctx
->
priv_data
;
av_freep
(
&
q
->
out_samples
[
0
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
0
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
1
]);
ff_mdct_end
(
&
q
->
mdct_ctx
[
2
]);
return
0
;
}
AVCodec
ff_atrac1_decoder
=
{
.
name
=
"atrac1"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
...
...
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