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
9ee5f674
Commit
9ee5f674
authored
Feb 10, 2010
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use calloc.
parent
347bfe4d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
13 deletions
+6
-13
modules/codec/zvbi.c
modules/codec/zvbi.c
+2
-4
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+1
-2
modules/misc/svg.c
modules/misc/svg.c
+2
-4
modules/video_filter/chain.c
modules/video_filter/chain.c
+1
-3
No files found.
modules/codec/zvbi.c
View file @
9ee5f674
...
@@ -206,10 +206,9 @@ static int Open( vlc_object_t *p_this )
...
@@ -206,10 +206,9 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
p_dec
->
pf_decode_sub
=
Decode
;
p_dec
->
pf_decode_sub
=
Decode
;
p_sys
=
p_dec
->
p_sys
=
malloc
(
sizeof
(
decoder_sys_t
)
);
p_sys
=
p_dec
->
p_sys
=
calloc
(
1
,
sizeof
(
decoder_sys_t
)
);
if
(
p_sys
==
NULL
)
if
(
p_sys
==
NULL
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
decoder_sys_t
)
);
p_sys
->
i_key
[
0
]
=
p_sys
->
i_key
[
1
]
=
p_sys
->
i_key
[
2
]
=
'*'
-
'0'
;
p_sys
->
i_key
[
0
]
=
p_sys
->
i_key
[
1
]
=
p_sys
->
i_key
[
2
]
=
'*'
-
'0'
;
p_sys
->
b_update
=
false
;
p_sys
->
b_update
=
false
;
...
@@ -246,8 +245,7 @@ static int Open( vlc_object_t *p_this )
...
@@ -246,8 +245,7 @@ static int Open( vlc_object_t *p_this )
/* Create the var on vlc_global. */
/* Create the var on vlc_global. */
p_sys
->
i_wanted_page
=
var_CreateGetInteger
(
p_dec
,
"vbi-page"
);
p_sys
->
i_wanted_page
=
var_CreateGetInteger
(
p_dec
,
"vbi-page"
);
var_AddCallback
(
p_dec
,
"vbi-page"
,
var_AddCallback
(
p_dec
,
"vbi-page"
,
RequestPage
,
p_sys
);
RequestPage
,
p_sys
);
/* Check if the Teletext track has a known "initial page". */
/* Check if the Teletext track has a known "initial page". */
if
(
p_sys
->
i_wanted_page
==
100
&&
p_dec
->
fmt_in
.
subs
.
teletext
.
i_magazine
!=
-
1
)
if
(
p_sys
->
i_wanted_page
==
100
&&
p_dec
->
fmt_in
.
subs
.
teletext
.
i_magazine
!=
-
1
)
...
...
modules/demux/mp4/mp4.c
View file @
9ee5f674
...
@@ -313,8 +313,7 @@ static int Open( vlc_object_t * p_this )
...
@@ -313,8 +313,7 @@ static int Open( vlc_object_t * p_this )
p_demux
->
pf_control
=
Control
;
p_demux
->
pf_control
=
Control
;
/* create our structure that will contains all data */
/* create our structure that will contains all data */
p_demux
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
demux_sys_t
)
);
p_demux
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
demux_sys_t
)
);
memset
(
p_sys
,
0
,
sizeof
(
demux_sys_t
)
);
/* Now load all boxes ( except raw data ) */
/* Now load all boxes ( except raw data ) */
if
(
(
p_sys
->
p_root
=
MP4_BoxGetRoot
(
p_demux
->
s
)
)
==
NULL
)
if
(
(
p_sys
->
p_root
=
MP4_BoxGetRoot
(
p_demux
->
s
)
)
==
NULL
)
...
...
modules/misc/svg.c
View file @
9ee5f674
...
@@ -195,14 +195,13 @@ static char *svg_GetTemplate( vlc_object_t *p_this )
...
@@ -195,14 +195,13 @@ static char *svg_GetTemplate( vlc_object_t *p_this )
msg_Dbg
(
p_this
,
"reading %ld bytes from template %s"
,
msg_Dbg
(
p_this
,
"reading %ld bytes from template %s"
,
(
unsigned
long
)
s
.
st_size
,
psz_filename
);
(
unsigned
long
)
s
.
st_size
,
psz_filename
);
psz_template
=
malloc
(
s
.
st_size
+
42
);
psz_template
=
calloc
(
1
,
s
.
st_size
+
42
);
if
(
!
psz_template
)
if
(
!
psz_template
)
{
{
fclose
(
file
);
fclose
(
file
);
free
(
psz_filename
);
free
(
psz_filename
);
return
NULL
;
return
NULL
;
}
}
memset
(
psz_template
,
0
,
s
.
st_size
+
1
);
if
(
!
fread
(
psz_template
,
s
.
st_size
,
1
,
file
)
)
if
(
!
fread
(
psz_template
,
s
.
st_size
,
1
,
file
)
)
{
{
msg_Dbg
(
p_this
,
"No data read from template."
);
msg_Dbg
(
p_this
,
"No data read from template."
);
...
@@ -469,13 +468,12 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
...
@@ -469,13 +468,12 @@ static int RenderText( filter_t *p_filter, subpicture_region_t *p_region_out,
int
length
;
int
length
;
char
*
psz_template
=
p_sys
->
psz_template
;
char
*
psz_template
=
p_sys
->
psz_template
;
length
=
strlen
(
psz_string
)
+
strlen
(
psz_template
)
+
42
;
length
=
strlen
(
psz_string
)
+
strlen
(
psz_template
)
+
42
;
p_svg
->
psz_text
=
malloc
(
length
+
1
);
p_svg
->
psz_text
=
calloc
(
1
,
length
+
1
);
if
(
!
p_svg
->
psz_text
)
if
(
!
p_svg
->
psz_text
)
{
{
free
(
p_svg
);
free
(
p_svg
);
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
}
}
memset
(
p_svg
->
psz_text
,
0
,
length
+
1
);
snprintf
(
p_svg
->
psz_text
,
length
,
psz_template
,
psz_string
);
snprintf
(
p_svg
->
psz_text
,
length
,
psz_template
,
psz_string
);
}
}
p_svg
->
i_width
=
p_sys
->
i_width
;
p_svg
->
i_width
=
p_sys
->
i_width
;
...
...
modules/video_filter/chain.c
View file @
9ee5f674
...
@@ -91,12 +91,10 @@ static int Activate( vlc_object_t *p_this )
...
@@ -91,12 +91,10 @@ static int Activate( vlc_object_t *p_this )
if
(
!
b_chroma
&&
!
b_resize
)
if
(
!
b_chroma
&&
!
b_resize
)
return
VLC_EGENERIC
;
return
VLC_EGENERIC
;
p_sys
=
p_filter
->
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
);
p_sys
=
p_filter
->
p_sys
=
calloc
(
1
,
sizeof
(
*
p_sys
)
);
if
(
!
p_sys
)
if
(
!
p_sys
)
return
VLC_ENOMEM
;
return
VLC_ENOMEM
;
memset
(
p_sys
,
0
,
sizeof
(
*
p_sys
)
);
p_sys
->
p_chain
=
filter_chain_New
(
p_filter
,
"video filter2"
,
false
,
BufferAllocationInit
,
NULL
,
p_filter
);
p_sys
->
p_chain
=
filter_chain_New
(
p_filter
,
"video filter2"
,
false
,
BufferAllocationInit
,
NULL
,
p_filter
);
if
(
!
p_sys
->
p_chain
)
if
(
!
p_sys
->
p_chain
)
{
{
...
...
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