Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
27a40f30
Commit
27a40f30
authored
Feb 25, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
osd: use calloc and a bit of cleaning.
parent
c7d39074
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
13 deletions
+5
-13
modules/misc/osd/osd_menu.c
modules/misc/osd/osd_menu.c
+5
-13
No files found.
modules/misc/osd/osd_menu.c
View file @
27a40f30
...
...
@@ -49,16 +49,11 @@ osd_menu_t *osd_MenuNew( osd_menu_t *p_menu, const char *psz_path,
{
if
(
!
p_menu
)
return
NULL
;
p_menu
->
p_state
=
(
osd_menu_state_t
*
)
malloc
(
sizeof
(
osd_menu_state_t
)
);
p_menu
->
p_state
=
calloc
(
1
,
sizeof
(
osd_menu_state_t
)
);
if
(
!
p_menu
->
p_state
)
return
NULL
;
memset
(
p_menu
->
p_state
,
0
,
sizeof
(
osd_menu_state_t
));
if
(
psz_path
!=
NULL
)
p_menu
->
psz_path
=
strdup
(
psz_path
);
else
p_menu
->
psz_path
=
NULL
;
p_menu
->
psz_path
=
psz_path
?
strdup
(
psz_path
)
:
NULL
;
p_menu
->
i_x
=
i_x
;
p_menu
->
i_y
=
i_y
;
p_menu
->
i_style
=
OSD_MENU_STYLE_SIMPLE
;
...
...
@@ -89,11 +84,10 @@ void osd_MenuFree( osd_menu_t *p_menu )
osd_button_t
*
osd_ButtonNew
(
const
char
*
psz_action
,
int
i_x
,
int
i_y
)
{
osd_button_t
*
p_button
=
NULL
;
p_button
=
(
osd_button_t
*
)
malloc
(
sizeof
(
osd_button_t
)
);
p_button
=
calloc
(
1
,
sizeof
(
osd_button_t
)
);
if
(
!
p_button
)
return
NULL
;
memset
(
p_button
,
0
,
sizeof
(
osd_button_t
)
);
p_button
->
psz_action
=
strdup
(
psz_action
);
p_button
->
psz_action_down
=
NULL
;
p_button
->
p_feedback
=
NULL
;
...
...
@@ -186,7 +180,6 @@ void osd_ButtonFree( osd_menu_t *p_menu, osd_button_t *p_button )
osd_StatesFree
(
p_menu
,
p_button
->
p_states
);
free
(
p_button
);
p_button
=
NULL
;
}
}
...
...
@@ -199,11 +192,10 @@ osd_state_t *osd_StateNew( osd_menu_t *p_menu, const char *psz_file,
osd_state_t
*
p_state
=
NULL
;
video_format_t
fmt_in
,
fmt_out
;
p_state
=
(
osd_state_t
*
)
malloc
(
sizeof
(
osd_state_t
)
);
p_state
=
calloc
(
1
,
sizeof
(
osd_state_t
)
);
if
(
!
p_state
)
return
NULL
;
memset
(
p_state
,
0
,
sizeof
(
osd_state_t
)
);
memset
(
&
fmt_in
,
0
,
sizeof
(
video_format_t
)
);
memset
(
&
fmt_out
,
0
,
sizeof
(
video_format_t
)
);
...
...
@@ -282,6 +274,6 @@ void osd_StatesFree( osd_menu_t *p_menu, osd_state_t *p_states )
}
free
(
p_state
->
psz_state
);
free
(
p_states
);
p_states
=
NULL
;
}
}
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