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
ad516dd2
Commit
ad516dd2
authored
Jul 17, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/resample2: Use av_malloc(z)_array()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
f46e8760
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
resample2.c
libavcodec/resample2.c
+2
-2
No files found.
libavcodec/resample2.c
View file @
ad516dd2
...
...
@@ -102,7 +102,7 @@ static double bessel(double x){
static
int
build_filter
(
FELEM
*
filter
,
double
factor
,
int
tap_count
,
int
phase_count
,
int
scale
,
int
type
){
int
ph
,
i
;
double
x
,
y
,
w
;
double
*
tab
=
av_malloc
(
tap_count
*
sizeof
(
*
tab
));
double
*
tab
=
av_malloc
_array
(
tap_count
,
sizeof
(
*
tab
));
const
int
center
=
(
tap_count
-
1
)
/
2
;
if
(
!
tab
)
...
...
@@ -202,7 +202,7 @@ AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_size,
c
->
linear
=
linear
;
c
->
filter_length
=
FFMAX
((
int
)
ceil
(
filter_size
/
factor
),
1
);
c
->
filter_bank
=
av_mallocz
(
c
->
filter_length
*
(
phase_count
+
1
)
*
sizeof
(
FELEM
));
c
->
filter_bank
=
av_mallocz
_array
(
c
->
filter_length
,
(
phase_count
+
1
)
*
sizeof
(
FELEM
));
if
(
!
c
->
filter_bank
)
goto
error
;
if
(
build_filter
(
c
->
filter_bank
,
factor
,
c
->
filter_length
,
phase_count
,
1
<<
FILTER_SHIFT
,
WINDOW_TYPE
))
...
...
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