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
b56560d7
Commit
b56560d7
authored
Mar 11, 2010
by
Fabio Ritrovato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lua SD: check if p_input exists before using it
parent
18cb2997
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
92 additions
and
80 deletions
+92
-80
modules/misc/lua/libs/sd.c
modules/misc/lua/libs/sd.c
+92
-80
No files found.
modules/misc/lua/libs/sd.c
View file @
b56560d7
...
...
@@ -120,7 +120,8 @@ static int vlclua_sd_add_node( lua_State *L )
"vlc://nop"
,
name
,
0
,
NULL
,
0
,
-
1
,
ITEM_TYPE_NODE
);
free
(
name
);
if
(
p_input
)
{
lua_getfield
(
L
,
-
1
,
"arturl"
);
if
(
lua_isstring
(
L
,
-
1
)
&&
strcmp
(
lua_tostring
(
L
,
-
1
),
""
)
)
{
...
...
@@ -143,6 +144,8 @@ static int vlclua_sd_add_node( lua_State *L )
}
lua_setmetatable
(
L
,
-
2
);
}
free
(
name
);
}
else
msg_Err
(
p_sd
,
"vlc.sd.add_node: the
\"
title
\"
parameter can't be empty"
);
}
...
...
@@ -168,7 +171,8 @@ static int vlclua_sd_add_item( lua_State *L )
i_options
,
(
const
char
**
)
ppsz_options
,
VLC_INPUT_OPTION_TRUSTED
,
-
1
);
free
(
psz_path
);
if
(
p_input
)
{
vlclua_read_meta_data
(
p_sd
,
L
,
p_input
);
/* This one is to be tested... */
vlclua_read_custom_meta_data
(
p_sd
,
L
,
p_input
);
...
...
@@ -190,6 +194,8 @@ static int vlclua_sd_add_item( lua_State *L )
}
lua_setmetatable
(
L
,
-
2
);
vlc_gc_decref
(
p_input
);
}
free
(
psz_path
);
while
(
i_options
>
0
)
free
(
ppsz_options
[
--
i_options
]
);
free
(
ppsz_options
);
...
...
@@ -237,7 +243,8 @@ static int vlclua_node_add_subitem( lua_State *L )
psz_path
,
i_options
,
(
const
char
**
)
ppsz_options
,
VLC_INPUT_OPTION_TRUSTED
,
-
1
);
free
(
psz_path
);
if
(
p_input
)
{
vlclua_read_meta_data
(
p_sd
,
L
,
p_input
);
/* This one is to be tested... */
vlclua_read_custom_meta_data
(
p_sd
,
L
,
p_input
);
...
...
@@ -259,6 +266,8 @@ static int vlclua_node_add_subitem( lua_State *L )
}
lua_setmetatable
(
L
,
-
2
);
vlc_gc_decref
(
p_input
);
}
free
(
psz_path
);
while
(
i_options
>
0
)
free
(
ppsz_options
[
--
i_options
]
);
free
(
ppsz_options
);
...
...
@@ -290,7 +299,8 @@ static int vlclua_node_add_node( lua_State *L )
"vlc://nop"
,
name
,
0
,
NULL
,
0
,
-
1
,
ITEM_TYPE_NODE
);
free
(
name
);
if
(
p_input
)
{
lua_getfield
(
L
,
-
1
,
"arturl"
);
if
(
lua_isstring
(
L
,
-
1
)
&&
strcmp
(
lua_tostring
(
L
,
-
1
),
""
)
)
{
...
...
@@ -313,6 +323,8 @@ static int vlclua_node_add_node( lua_State *L )
}
lua_setmetatable
(
L
,
-
2
);
}
free
(
name
);
}
else
msg_Err
(
p_sd
,
"node:add_node: the
\"
title
\"
parameter can't be empty"
);
}
...
...
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