Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
6aa9a2b1
Commit
6aa9a2b1
authored
Aug 20, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix potential memleaks.
parent
1a4fe53c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
modules/audio_filter/normvol.c
modules/audio_filter/normvol.c
+16
-2
No files found.
modules/audio_filter/normvol.c
View file @
6aa9a2b1
...
...
@@ -131,6 +131,8 @@ static int Open( vlc_object_t *p_this )
i_channels
=
aout_FormatNbChannels
(
&
p_filter
->
input
);
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
aout_filter_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
p_sys
->
i_nb
=
var_CreateGetInteger
(
p_filter
->
p_parent
,
"norm-buff-size"
);
p_sys
->
f_max
=
var_CreateGetFloat
(
p_filter
->
p_parent
,
"norm-max-level"
);
...
...
@@ -139,6 +141,11 @@ static int Open( vlc_object_t *p_this )
/* We need to store (nb_buffers+1)*nb_channels floats */
p_sys
->
p_last
=
malloc
(
sizeof
(
float
)
*
(
i_channels
)
*
(
p_filter
->
p_sys
->
i_nb
+
2
)
);
if
(
!
p_sys
->
p_last
)
{
free
(
p_sys
);
return
VLC_ENOMEM
;
}
memset
(
p_sys
->
p_last
,
0
,
sizeof
(
float
)
*
(
i_channels
)
*
(
p_filter
->
p_sys
->
i_nb
+
2
)
);
return
VLC_SUCCESS
;
...
...
@@ -162,10 +169,17 @@ static int Open( vlc_object_t *p_this )
struct
aout_filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
pf_sum
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
i_channels
);
pf_sum
=
malloc
(
sizeof
(
float
)
*
i_channels
);
if
(
!
pf_sum
)
return
;
memset
(
pf_sum
,
0
,
sizeof
(
float
)
*
i_channels
);
pf_gain
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
i_channels
);
pf_gain
=
malloc
(
sizeof
(
float
)
*
i_channels
);
if
(
!
pf_gain
)
{
free
(
pf_sum
);
return
;
}
p_out_buf
->
i_nb_samples
=
p_in_buf
->
i_nb_samples
;
p_out_buf
->
i_nb_bytes
=
p_in_buf
->
i_nb_bytes
;
...
...
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