Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
f6d9ebe6
Commit
f6d9ebe6
authored
Dec 12, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use calloc instead of malloc+memset.
parent
4b090cbd
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
28 additions
and
43 deletions
+28
-43
modules/access/bda/bda.c
modules/access/bda/bda.c
+1
-3
modules/access/dc1394.c
modules/access/dc1394.c
+1
-2
modules/access/dshow/dshow.cpp
modules/access/dshow/dshow.cpp
+2
-4
modules/access/dvb/access.c
modules/access/dvb/access.c
+1
-3
modules/access/ftp.c
modules/access/ftp.c
+2
-3
modules/access/jack.c
modules/access/jack.c
+1
-2
modules/access/mms/mmsh.c
modules/access/mms/mmsh.c
+1
-3
modules/access/mms/mmstu.c
modules/access/mms/mmstu.c
+1
-2
modules/access/qtcapture.m
modules/access/qtcapture.m
+3
-3
modules/access/screen/screen.c
modules/access/screen/screen.c
+3
-2
modules/access/screen/win32.c
modules/access/screen/win32.c
+1
-2
modules/access/v4l.c
modules/access/v4l.c
+3
-2
modules/access/vcd/vcd.c
modules/access/vcd/vcd.c
+3
-2
modules/audio_filter/converter/dtstospdif.c
modules/audio_filter/converter/dtstospdif.c
+2
-4
modules/audio_filter/normvol.c
modules/audio_filter/normvol.c
+3
-6
No files found.
modules/access/bda/bda.c
View file @
f6d9ebe6
...
...
@@ -316,12 +316,10 @@ static int Open( vlc_object_t *p_this )
p_access
->
info
.
b_eof
=
false
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
(
access_sys_t
*
)
malloc
(
sizeof
(
access_sys_t
)
);
p_access
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
for
(
int
i
=
0
;
i
<
i_param_count
;
i
++
)
{
snprintf
(
psz_full_name
,
128
,
"%s-%s
\0
"
,
psz_module
,
...
...
modules/access/dc1394.c
View file @
f6d9ebe6
...
...
@@ -225,10 +225,9 @@ static int Open( vlc_object_t *p_this )
p_demux
->
info
.
i_title
=
0
;
p_demux
->
info
.
i_seekpoint
=
0
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
p_demux
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
demux_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
memset
(
&
fmt
,
0
,
sizeof
(
es_format_t
)
);
/* DEFAULTS */
...
...
modules/access/dshow/dshow.cpp
View file @
f6d9ebe6
...
...
@@ -579,10 +579,9 @@ static int DemuxOpen( vlc_object_t *p_this )
access_sys_t
*
p_sys
;
int
i
;
p_sys
=
(
access_sys_t
*
)
malloc
(
sizeof
(
access_sys_t
)
);
p_sys
=
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
p_demux
->
p_sys
=
(
demux_sys_t
*
)
p_sys
;
if
(
CommonOpen
(
p_this
,
p_sys
,
true
)
!=
VLC_SUCCESS
)
...
...
@@ -663,10 +662,9 @@ static int AccessOpen( vlc_object_t *p_this )
access_t
*
p_access
=
(
access_t
*
)
p_this
;
access_sys_t
*
p_sys
;
p_access
->
p_sys
=
p_sys
=
(
access_sys_t
*
)
malloc
(
sizeof
(
access_sys_t
)
);
p_access
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
if
(
CommonOpen
(
p_this
,
p_sys
,
false
)
!=
VLC_SUCCESS
)
{
...
...
modules/access/dvb/access.c
View file @
f6d9ebe6
...
...
@@ -327,12 +327,10 @@ static int Open( vlc_object_t *p_this )
access_InitFields
(
p_access
);
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
p_access
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
/* Create all variables */
VarInit
(
p_access
);
...
...
modules/access/ftp.c
View file @
f6d9ebe6
...
...
@@ -367,10 +367,9 @@ static int OutOpen( vlc_object_t *p_this )
sout_access_out_t
*
p_access
=
(
sout_access_out_t
*
)
p_this
;
access_sys_t
*
p_sys
;
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
if
(
p_sys
==
NULL
)
p_sys
=
calloc
(
1
,
sizeof
(
*
p_sys
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
*
p_sys
)
);
/* Init p_access */
p_sys
->
fd_data
=
-
1
;
...
...
modules/access/jack.c
View file @
f6d9ebe6
...
...
@@ -142,9 +142,8 @@ static int Open( vlc_object_t *p_this )
/* Allocate structure */
p_demux
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
demux_sys_t
)
);
if
(
p_sys
==
NULL
)
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
/* Parse MRL */
Parse
(
p_demux
);
...
...
modules/access/mms/mmsh.c
View file @
f6d9ebe6
...
...
@@ -93,14 +93,12 @@ int MMSHOpen( access_t *p_access )
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
p_access
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
p_sys
->
i_proto
=
MMS_PROTO_HTTP
;
p_sys
->
fd
=
-
1
;
p_sys
->
i_start
=
0
;
/* Handle proxy */
p_sys
->
b_proxy
=
false
;
...
...
modules/access/mms/mmstu.c
View file @
f6d9ebe6
...
...
@@ -112,9 +112,8 @@ int MMSTUOpen( access_t *p_access )
p_access
->
info
.
b_eof
=
false
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
p_access
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
p_sys
->
i_timeout
=
var_CreateGetInteger
(
p_access
,
"mms-timeout"
);
...
...
modules/access/qtcapture.m
View file @
f6d9ebe6
...
...
@@ -210,10 +210,10 @@ static int Open( vlc_object_t *p_this )
p_demux
->
info
.
i_title
=
0
;
p_demux
->
info
.
i_seekpoint
=
0
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
p_demux
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
demux_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
memset
(
&
fmt
,
0
,
sizeof
(
es_format_t
)
);
QTCaptureDeviceInput
*
input
=
nil
;
...
...
modules/access/screen/screen.c
View file @
f6d9ebe6
...
...
@@ -142,8 +142,9 @@ static int Open( vlc_object_t *p_this )
/* Fill p_demux field */
p_demux
->
pf_demux
=
Demux
;
p_demux
->
pf_control
=
Control
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
p_demux
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
demux_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
/* Update default_pts to a suitable value for screen access */
var_Create
(
p_demux
,
"screen-caching"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
...
...
modules/access/screen/win32.c
View file @
f6d9ebe6
...
...
@@ -55,10 +55,9 @@ int screen_InitCapture( demux_t *p_demux )
screen_data_t
*
p_data
;
int
i_chroma
,
i_bits_per_pixel
;
p_sys
->
p_data
=
p_data
=
malloc
(
sizeof
(
screen_data_t
)
);
p_sys
->
p_data
=
p_data
=
calloc
(
sizeof
(
1
,
screen_data_t
)
);
if
(
!
p_data
)
return
VLC_ENOMEM
;
memset
(
p_data
,
0
,
sizeof
(
screen_data_t
)
);
/* Get the device context for the whole screen */
p_data
->
hdc_src
=
CreateDC
(
"DISPLAY"
,
NULL
,
NULL
,
NULL
);
...
...
modules/access/v4l.c
View file @
f6d9ebe6
...
...
@@ -333,8 +333,9 @@ static int Open( vlc_object_t *p_this )
p_demux
->
info
.
i_update
=
0
;
p_demux
->
info
.
i_title
=
0
;
p_demux
->
info
.
i_seekpoint
=
0
;
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
p_demux
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
demux_sys_t
)
);
if
(
!
p_sys
)
return
VLC_ENOMEM
;
var_Create
(
p_demux
,
"v4l-audio"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_demux
,
"v4l-audio"
,
&
val
);
...
...
modules/access/vcd/vcd.c
View file @
f6d9ebe6
...
...
@@ -154,8 +154,9 @@ static int Open( vlc_object_t *p_this )
p_access
->
info
.
b_eof
=
false
;
p_access
->
info
.
i_title
=
0
;
p_access
->
info
.
i_seekpoint
=
0
;
p_access
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
access_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
access_sys_t
)
);
p_access
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
access_sys_t
)
);
if
(
!
p_sys
)
goto
error
;
p_sys
->
vcddev
=
vcddev
;
/* We read the Table Of Content information */
...
...
modules/audio_filter/converter/dtstospdif.c
View file @
f6d9ebe6
...
...
@@ -89,11 +89,9 @@ static int Create( vlc_object_t *p_this )
}
/* Allocate the memory needed to store the module's structure */
p_filter
->
p_sys
=
malloc
(
sizeof
(
struct
aout_filter_sys_t
)
);
if
(
p_filter
->
p_sys
==
NULL
)
p_filter
->
p_sys
=
calloc
(
1
,
sizeof
(
struct
aout_filter_sys_t
)
);
if
(
!
p_filter
->
p_sys
)
return
VLC_ENOMEM
;
memset
(
p_filter
->
p_sys
,
0
,
sizeof
(
struct
aout_filter_sys_t
)
);
p_filter
->
p_sys
->
p_buf
=
0
;
p_filter
->
pf_do_work
=
DoWork
;
p_filter
->
b_in_place
=
1
;
...
...
modules/audio_filter/normvol.c
View file @
f6d9ebe6
...
...
@@ -139,15 +139,13 @@ static int Open( vlc_object_t *p_this )
if
(
p_sys
->
f_max
<=
0
)
p_sys
->
f_max
=
0
.
01
;
/* 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
)
);
p_sys
->
p_last
=
calloc
(
i_channels
*
(
p_filter
->
p_sys
->
i_nb
+
2
),
sizeof
(
float
)
);
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
;
}
...
...
@@ -169,10 +167,9 @@ static int Open( vlc_object_t *p_this )
struct
aout_filter_sys_t
*
p_sys
=
p_filter
->
p_sys
;
pf_sum
=
malloc
(
sizeof
(
float
)
*
i_channels
);
pf_sum
=
calloc
(
i_channels
,
sizeof
(
float
)
);
if
(
!
pf_sum
)
return
;
memset
(
pf_sum
,
0
,
sizeof
(
float
)
*
i_channels
);
pf_gain
=
malloc
(
sizeof
(
float
)
*
i_channels
);
if
(
!
pf_gain
)
...
...
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