Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
997feb29
Commit
997feb29
authored
Oct 08, 2007
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v4l2: replaces bad malloc( sizeof(x) * i )/memset(&, 0, sizeof(x)) by calloc(1, sizeof(x) * i)
removes extra spaces, removes tabs
parent
a2157f6e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
189 additions
and
194 deletions
+189
-194
modules/access/v4l2.c
modules/access/v4l2.c
+189
-194
No files found.
modules/access/v4l2.c
View file @
997feb29
...
...
@@ -276,9 +276,8 @@ 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
==
NULL
)
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
p_sys
->
i_video_pts
=
-
1
;
...
...
@@ -1538,9 +1537,8 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
p_sys
->
i_input
++
;
}
p_sys
->
p_inputs
=
malloc
(
p_sys
->
i_input
*
sizeof
(
struct
v4l2_input
)
);
p_sys
->
p_inputs
=
calloc
(
1
,
p_sys
->
i_input
*
sizeof
(
struct
v4l2_input
)
);
if
(
!
p_sys
->
p_inputs
)
goto
open_failed
;
memset
(
p_sys
->
p_inputs
,
0
,
sizeof
(
struct
v4l2_input
)
);
for
(
i_index
=
0
;
i_index
<
p_sys
->
i_input
;
i_index
++
)
{
...
...
@@ -1572,9 +1570,8 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
t_standards
.
index
=
p_sys
->
i_standard
;
}
p_sys
->
p_standards
=
malloc
(
p_sys
->
i_standard
*
sizeof
(
struct
v4l2_standard
)
);
p_sys
->
p_standards
=
calloc
(
1
,
p_sys
->
i_standard
*
sizeof
(
struct
v4l2_standard
)
);
if
(
!
p_sys
->
p_standards
)
goto
open_failed
;
memset
(
p_sys
->
p_standards
,
0
,
sizeof
(
struct
v4l2_standard
)
);
for
(
i_standard
=
0
;
i_standard
<
p_sys
->
i_standard
;
i_standard
++
)
{
...
...
@@ -1632,9 +1629,8 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
tuner
.
index
=
p_sys
->
i_tuner
;
}
p_sys
->
p_tuners
=
malloc
(
p_sys
->
i_tuner
*
sizeof
(
struct
v4l2_tuner
)
);
p_sys
->
p_tuners
=
calloc
(
1
,
p_sys
->
i_tuner
*
sizeof
(
struct
v4l2_tuner
)
);
if
(
!
p_sys
->
p_tuners
)
goto
open_failed
;
memset
(
p_sys
->
p_tuners
,
0
,
sizeof
(
struct
v4l2_tuner
)
);
for
(
i_index
=
0
;
i_index
<
p_sys
->
i_tuner
;
i_index
++
)
{
...
...
@@ -1681,8 +1677,7 @@ vlc_bool_t ProbeVideoDev( demux_t *p_demux, char *psz_device )
p_sys
->
i_codec
=
i_index
;
p_sys
->
p_codecs
=
malloc
(
p_sys
->
i_codec
*
sizeof
(
struct
v4l2_fmtdesc
)
);
memset
(
p_sys
->
p_codecs
,
0
,
p_sys
->
i_codec
*
sizeof
(
struct
v4l2_fmtdesc
)
);
p_sys
->
p_codecs
=
calloc
(
1
,
p_sys
->
i_codec
*
sizeof
(
struct
v4l2_fmtdesc
)
);
for
(
i_index
=
0
;
i_index
<
p_sys
->
i_codec
;
i_index
++
)
{
...
...
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