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
68f7e9cd
Commit
68f7e9cd
authored
Oct 10, 2011
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alacdec: simplify buffer allocation by using FF_ALLOC_OR_GOTO()
parent
b316af7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
alac.c
libavcodec/alac.c
+10
-11
No files found.
libavcodec/alac.c
View file @
68f7e9cd
...
...
@@ -548,22 +548,21 @@ static int allocate_buffers(ALACContext *alac)
{
int
ch
;
for
(
ch
=
0
;
ch
<
alac
->
numchannels
;
ch
++
)
{
alac
->
predicterror_buffer
[
ch
]
=
av_malloc
(
alac
->
setinfo_max_samples_per_frame
*
4
);
int
buf_size
=
alac
->
setinfo_max_samples_per_frame
*
sizeof
(
int32_t
);
alac
->
outputsamples_buffer
[
ch
]
=
av_malloc
(
alac
->
setinfo_max_samples_per_frame
*
4
);
FF_ALLOC_OR_GOTO
(
alac
->
avctx
,
alac
->
predicterror_buffer
[
ch
],
buf_size
,
buf_alloc_fail
);
alac
->
extra_bits_buffer
[
ch
]
=
av_malloc
(
alac
->
setinfo_max_samples_per_frame
*
4
);
FF_ALLOC_OR_GOTO
(
alac
->
avctx
,
alac
->
outputsamples_buffer
[
ch
],
buf_size
,
buf_alloc_fail
);
if
(
!
alac
->
predicterror_buffer
[
ch
]
||
!
alac
->
outputsamples_buffer
[
ch
]
||
!
alac
->
extra_bits_buffer
[
ch
])
{
alac_decode_close
(
alac
->
avctx
);
return
AVERROR
(
ENOMEM
);
}
FF_ALLOC_OR_GOTO
(
alac
->
avctx
,
alac
->
extra_bits_buffer
[
ch
],
buf_size
,
buf_alloc_fail
);
}
return
0
;
buf_alloc_fail
:
alac_decode_close
(
alac
->
avctx
);
return
AVERROR
(
ENOMEM
);
}
static
int
alac_set_info
(
ALACContext
*
alac
)
...
...
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