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
bc21bdf0
Commit
bc21bdf0
authored
Jan 26, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hotkeys: fix potential buffer overflows, use var_CreateGetString,
fix memleaks and use pl_Release.
parent
e3895ba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
modules/control/hotkeys.c
modules/control/hotkeys.c
+15
-11
No files found.
modules/control/hotkeys.c
View file @
bc21bdf0
/*****************************************************************************
/*****************************************************************************
* hotkeys.c: Hotkey handling for vlc
* hotkeys.c: Hotkey handling for vlc
*****************************************************************************
*****************************************************************************
* Copyright (C) 2005 the VideoLAN team
* Copyright (C) 2005
-2009
the VideoLAN team
* $Id$
* $Id$
*
*
* Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
* Authors: Sigmund Augdal Helberg <dnumgis@videolan.org>
...
@@ -952,15 +952,13 @@ static int ActionEvent( vlc_object_t *libvlc, char const *psz_var,
...
@@ -952,15 +952,13 @@ static int ActionEvent( vlc_object_t *libvlc, char const *psz_var,
static
void
PlayBookmark
(
intf_thread_t
*
p_intf
,
int
i_num
)
static
void
PlayBookmark
(
intf_thread_t
*
p_intf
,
int
i_num
)
{
{
vlc_value_t
val
;
char
*
psz_bookmark_name
;
char
psz_bookmark_name
[
11
];
if
(
asprintf
(
&
psz_bookmark_name
,
"bookmark%i"
,
i_num
)
==
-
1
)
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
)
;
return
;
sprintf
(
psz_bookmark_name
,
"bookmark%i"
,
i_num
);
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
var_Create
(
p_intf
,
psz_bookmark_name
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
char
*
psz_bookmark
=
var_CreateGetString
(
p_intf
,
psz_bookmark_name
);
var_Get
(
p_intf
,
psz_bookmark_name
,
&
val
);
char
*
psz_bookmark
=
strdup
(
val
.
psz_string
);
PL_LOCK
;
PL_LOCK
;
FOREACH_ARRAY
(
playlist_item_t
*
p_item
,
p_playlist
->
items
)
FOREACH_ARRAY
(
playlist_item_t
*
p_item
,
p_playlist
->
items
)
char
*
psz_uri
=
input_item_GetURI
(
p_item
->
p_input
);
char
*
psz_uri
=
input_item_GetURI
(
p_item
->
p_input
);
...
@@ -975,15 +973,19 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
...
@@ -975,15 +973,19 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
free
(
psz_uri
);
free
(
psz_uri
);
FOREACH_END
();
FOREACH_END
();
PL_UNLOCK
;
PL_UNLOCK
;
free
(
psz_bookmark
);
free
(
psz_bookmark
);
vlc_object_release
(
p_playlist
);
free
(
psz_bookmark_name
);
pl_Release
(
p_intf
);
}
}
static
void
SetBookmark
(
intf_thread_t
*
p_intf
,
int
i_num
)
static
void
SetBookmark
(
intf_thread_t
*
p_intf
,
int
i_num
)
{
{
char
*
psz_bookmark_name
;
if
(
asprintf
(
&
psz_bookmark_name
,
"bookmark%i"
,
i_num
)
==
-
1
)
return
;
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
playlist_t
*
p_playlist
=
pl_Hold
(
p_intf
);
char
psz_bookmark_name
[
11
];
sprintf
(
psz_bookmark_name
,
"bookmark%i"
,
i_num
);
var_Create
(
p_intf
,
psz_bookmark_name
,
var_Create
(
p_intf
,
psz_bookmark_name
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
playlist_item_t
*
p_item
=
playlist_CurrentPlayingItem
(
p_playlist
);
playlist_item_t
*
p_item
=
playlist_CurrentPlayingItem
(
p_playlist
);
...
@@ -995,7 +997,9 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
...
@@ -995,7 +997,9 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
free
(
psz_uri
);
free
(
psz_uri
);
config_SaveConfigFile
(
p_intf
,
"hotkeys"
);
config_SaveConfigFile
(
p_intf
,
"hotkeys"
);
}
}
pl_Release
(
p_intf
);
pl_Release
(
p_intf
);
free
(
psz_bookmark_name
);
}
}
static
void
DisplayPosition
(
intf_thread_t
*
p_intf
,
vout_thread_t
*
p_vout
,
static
void
DisplayPosition
(
intf_thread_t
*
p_intf
,
vout_thread_t
*
p_vout
,
...
...
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