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
47b61702
Commit
47b61702
authored
Oct 28, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
atrac3: make sure all memory is freed on init failure
parent
c9161385
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
atrac3.c
libavcodec/atrac3.c
+9
-5
No files found.
libavcodec/atrac3.c
View file @
47b61702
...
@@ -196,7 +196,7 @@ static int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){
...
@@ -196,7 +196,7 @@ static int decode_bytes(const uint8_t* inbuffer, uint8_t* out, int bytes){
}
}
static
av_cold
void
init_atrac3_transforms
(
ATRAC3Context
*
q
)
{
static
av_cold
int
init_atrac3_transforms
(
ATRAC3Context
*
q
)
{
float
enc_window
[
256
];
float
enc_window
[
256
];
int
i
;
int
i
;
...
@@ -212,7 +212,7 @@ static av_cold void init_atrac3_transforms(ATRAC3Context *q) {
...
@@ -212,7 +212,7 @@ static av_cold void init_atrac3_transforms(ATRAC3Context *q) {
}
}
/* Initialize the MDCT transform. */
/* Initialize the MDCT transform. */
ff_mdct_init
(
&
q
->
mdct_ctx
,
9
,
1
,
1
.
0
/
32768
);
return
ff_mdct_init
(
&
q
->
mdct_ctx
,
9
,
1
,
1
.
0
/
32768
);
}
}
/**
/**
...
@@ -880,7 +880,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
...
@@ -880,7 +880,7 @@ static int atrac3_decode_frame(AVCodecContext *avctx,
static
av_cold
int
atrac3_decode_init
(
AVCodecContext
*
avctx
)
static
av_cold
int
atrac3_decode_init
(
AVCodecContext
*
avctx
)
{
{
int
i
;
int
i
,
ret
;
const
uint8_t
*
edata_ptr
=
avctx
->
extradata
;
const
uint8_t
*
edata_ptr
=
avctx
->
extradata
;
ATRAC3Context
*
q
=
avctx
->
priv_data
;
ATRAC3Context
*
q
=
avctx
->
priv_data
;
static
VLC_TYPE
atrac3_vlc_table
[
4096
][
2
];
static
VLC_TYPE
atrac3_vlc_table
[
4096
][
2
];
...
@@ -986,7 +986,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
...
@@ -986,7 +986,11 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
vlcs_initialized
=
1
;
vlcs_initialized
=
1
;
}
}
init_atrac3_transforms
(
q
);
if
((
ret
=
init_atrac3_transforms
(
q
)))
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Error initializing MDCT
\n
"
);
av_freep
(
&
q
->
decoded_bytes_buffer
);
return
ret
;
}
atrac_generate_tables
();
atrac_generate_tables
();
...
@@ -1016,7 +1020,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
...
@@ -1016,7 +1020,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx)
q
->
pUnits
=
av_mallocz
(
sizeof
(
channel_unit
)
*
q
->
channels
);
q
->
pUnits
=
av_mallocz
(
sizeof
(
channel_unit
)
*
q
->
channels
);
if
(
!
q
->
pUnits
)
{
if
(
!
q
->
pUnits
)
{
a
v_free
(
q
->
decoded_bytes_buffer
);
a
trac3_decode_close
(
avctx
);
return
AVERROR
(
ENOMEM
);
return
AVERROR
(
ENOMEM
);
}
}
...
...
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