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
9676321a
Commit
9676321a
authored
Sep 03, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux/playlit/*: Check asprintf return malloc.
parent
c14bb395
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
44 deletions
+71
-44
modules/demux/playlist/asx.c
modules/demux/playlist/asx.c
+29
-22
modules/demux/playlist/dvb.c
modules/demux/playlist/dvb.c
+6
-6
modules/demux/playlist/playlist.c
modules/demux/playlist/playlist.c
+4
-2
modules/demux/playlist/sgimb.c
modules/demux/playlist/sgimb.c
+32
-14
No files found.
modules/demux/playlist/asx.c
View file @
9676321a
...
@@ -504,26 +504,32 @@ static int Demux( demux_t *p_demux )
...
@@ -504,26 +504,32 @@ static int Demux( demux_t *p_demux )
{
{
if
(
i_starttime
||
i_duration
)
if
(
i_starttime
||
i_duration
)
{
{
if
(
i_starttime
)
{
if
(
i_starttime
)
asprintf
(
ppsz_options
+
i_options
,
":start-time=%d"
,
i_starttime
);
{
if
(
asprintf
(
ppsz_options
+
i_options
,
":start-time=%d"
,
i_starttime
)
==
-
1
)
*
(
ppsz_options
+
i_options
)
=
NULL
;
else
++
i_options
;
++
i_options
;
}
}
if
(
i_duration
)
{
if
(
i_duration
)
asprintf
(
ppsz_options
+
i_options
,
":stop-time=%d"
,
i_starttime
+
i_duration
);
{
if
(
asprintf
(
ppsz_options
+
i_options
,
":stop-time=%d"
,
i_starttime
+
i_duration
)
==
-
1
)
*
(
ppsz_options
+
i_options
)
=
NULL
;
else
++
i_options
;
++
i_options
;
}
}
}
}
/* create the new entry */
/* create the new entry */
asprintf
(
&
psz_name
,
"%d %s"
,
i_entry_count
,
(
psz_title_entry
?
psz_title_entry
:
p_current_input
->
psz_name
)
);
if
(
asprintf
(
&
psz_name
,
"%d %s"
,
i_entry_count
,
(
psz_title_entry
?
psz_title_entry
:
p_current_input
->
psz_name
)
)
!=
-
1
)
{
p_entry
=
input_item_NewExt
(
p_demux
,
psz_href
,
psz_name
,
i_options
,
(
const
char
*
const
*
)
ppsz_options
,
-
1
);
p_entry
=
input_item_NewExt
(
p_demux
,
psz_href
,
psz_name
,
i_options
,
(
const
char
*
const
*
)
ppsz_options
,
-
1
);
FREENULL
(
psz_name
);
FREENULL
(
psz_name
);
input_item_CopyOptions
(
p_current_input
,
p_entry
);
input_item_CopyOptions
(
p_current_input
,
p_entry
);
while
(
i_options
)
while
(
i_options
)
{
{
psz_name
=
ppsz_options
[
--
i_options
];
psz_name
=
ppsz_options
[
--
i_options
];
FREENULL
(
psz_name
);
FREENULL
(
psz_name
);
}
}
if
(
psz_title_entry
)
input_item_SetTitle
(
p_entry
,
psz_title_entry
);
if
(
psz_title_entry
)
input_item_SetTitle
(
p_entry
,
psz_title_entry
);
...
@@ -534,6 +540,7 @@ static int Demux( demux_t *p_demux )
...
@@ -534,6 +540,7 @@ static int Demux( demux_t *p_demux )
input_item_AddSubItem
(
p_current_input
,
p_entry
);
input_item_AddSubItem
(
p_current_input
,
p_entry
);
vlc_gc_decref
(
p_entry
);
vlc_gc_decref
(
p_entry
);
}
}
}
/* cleanup entry */
;
/* cleanup entry */
;
FREENULL
(
psz_href
);
FREENULL
(
psz_href
);
...
...
modules/demux/playlist/dvb.c
View file @
9676321a
...
@@ -288,7 +288,7 @@ static int ParseLine( char *psz_line, char **ppsz_name,
...
@@ -288,7 +288,7 @@ static int ParseLine( char *psz_line, char **ppsz_name,
{
{
char
*
psz_option
;
char
*
psz_option
;
asprintf
(
&
psz_option
,
"program=%i"
,
i_program
);
if
(
asprintf
(
&
psz_option
,
"program=%i"
,
i_program
)
!=
-
1
)
INSERT_ELEM
(
*
pppsz_options
,
(
*
pi_options
),
(
*
pi_options
),
INSERT_ELEM
(
*
pppsz_options
,
(
*
pi_options
),
(
*
pi_options
),
psz_option
);
psz_option
);
}
}
...
@@ -296,7 +296,7 @@ static int ParseLine( char *psz_line, char **ppsz_name,
...
@@ -296,7 +296,7 @@ static int ParseLine( char *psz_line, char **ppsz_name,
{
{
char
*
psz_option
;
char
*
psz_option
;
asprintf
(
&
psz_option
,
"dvb-frequency=%i"
,
i_frequency
);
if
(
asprintf
(
&
psz_option
,
"dvb-frequency=%i"
,
i_frequency
)
!=
-
1
)
INSERT_ELEM
(
*
pppsz_options
,
(
*
pi_options
),
(
*
pi_options
),
INSERT_ELEM
(
*
pppsz_options
,
(
*
pi_options
),
(
*
pi_options
),
psz_option
);
psz_option
);
}
}
...
...
modules/demux/playlist/playlist.c
View file @
9676321a
...
@@ -180,6 +180,8 @@ char *ProcessMRL( char *psz_mrl, char *psz_prefix )
...
@@ -180,6 +180,8 @@ char *ProcessMRL( char *psz_mrl, char *psz_prefix )
if
(
strchr
(
psz_mrl
,
':'
)
)
return
strdup
(
psz_mrl
);
if
(
strchr
(
psz_mrl
,
':'
)
)
return
strdup
(
psz_mrl
);
/* This a relative path, prepend the prefix */
/* This a relative path, prepend the prefix */
asprintf
(
&
psz_mrl
,
"%s%s"
,
psz_prefix
,
psz_mrl
);
if
(
asprintf
(
&
psz_mrl
,
"%s%s"
,
psz_prefix
,
psz_mrl
)
!=
-
1
)
return
psz_mrl
;
return
psz_mrl
;
else
return
NULL
;
}
}
modules/demux/playlist/sgimb.c
View file @
9676321a
...
@@ -326,15 +326,23 @@ static int Demux ( demux_t *p_demux )
...
@@ -326,15 +326,23 @@ static int Demux ( demux_t *p_demux )
/* Definetly schedules multicast session */
/* Definetly schedules multicast session */
/* We don't care if it's live or not */
/* We don't care if it's live or not */
free
(
p_sys
->
psz_uri
);
free
(
p_sys
->
psz_uri
);
asprintf
(
&
p_sys
->
psz_uri
,
"udp://@"
"%s:%i"
,
p_sys
->
psz_mcast_ip
,
p_sys
->
i_mcast_port
);
if
(
asprintf
(
&
p_sys
->
psz_uri
,
"udp://@"
"%s:%i"
,
p_sys
->
psz_mcast_ip
,
p_sys
->
i_mcast_port
)
==
-
1
)
{
p_sys
->
psz_uri
=
NULL
;
return
-
1
;
}
}
}
if
(
p_sys
->
psz_uri
==
NULL
)
if
(
p_sys
->
psz_uri
==
NULL
)
{
{
if
(
p_sys
->
psz_server
&&
p_sys
->
psz_location
)
if
(
p_sys
->
psz_server
&&
p_sys
->
psz_location
)
{
{
asprintf
(
&
p_sys
->
psz_uri
,
"rtsp://"
"%s:%i%s"
,
if
(
asprintf
(
&
p_sys
->
psz_uri
,
"rtsp://"
"%s:%i%s"
,
p_sys
->
psz_server
,
p_sys
->
i_port
>
0
?
p_sys
->
i_port
:
554
,
p_sys
->
psz_location
);
p_sys
->
psz_server
,
p_sys
->
i_port
>
0
?
p_sys
->
i_port
:
554
,
p_sys
->
psz_location
)
==
-
1
)
{
p_sys
->
psz_uri
=
NULL
;
return
-
1
;
}
}
}
}
}
...
@@ -349,8 +357,12 @@ static int Demux ( demux_t *p_demux )
...
@@ -349,8 +357,12 @@ static int Demux ( demux_t *p_demux )
}
}
free
(
p_sys
->
psz_uri
);
free
(
p_sys
->
psz_uri
);
asprintf
(
&
p_sys
->
psz_uri
,
"%s%%3FMeDiAbAsEshowingId=%d%%26MeDiAbAsEconcert%%3FMeDiAbAsE"
,
if
(
asprintf
(
&
p_sys
->
psz_uri
,
"%s%%3FMeDiAbAsEshowingId=%d%%26MeDiAbAsEconcert%%3FMeDiAbAsE"
,
p_sys
->
psz_uri
,
p_sys
->
i_sid
);
p_sys
->
psz_uri
,
p_sys
->
i_sid
)
==
-
1
)
{
p_sys
->
psz_uri
=
NULL
;
return
-
1
;
}
}
}
p_child
=
input_item_NewWithType
(
VLC_OBJECT
(
p_demux
),
p_sys
->
psz_uri
,
p_child
=
input_item_NewWithType
(
VLC_OBJECT
(
p_demux
),
p_sys
->
psz_uri
,
...
@@ -368,24 +380,30 @@ static int Demux ( demux_t *p_demux )
...
@@ -368,24 +380,30 @@ static int Demux ( demux_t *p_demux )
{
{
char
*
psz_option
;
char
*
psz_option
;
p_sys
->
i_packet_size
+=
1000
;
p_sys
->
i_packet_size
+=
1000
;
asprintf
(
&
psz_option
,
"mtu=%i"
,
p_sys
->
i_packet_size
);
if
(
asprintf
(
&
psz_option
,
"mtu=%i"
,
p_sys
->
i_packet_size
)
!=
-
1
)
{
input_item_AddOption
(
p_child
,
psz_option
);
input_item_AddOption
(
p_child
,
psz_option
);
free
(
psz_option
);
free
(
psz_option
);
}
}
}
if
(
!
p_sys
->
psz_mcast_ip
)
if
(
!
p_sys
->
psz_mcast_ip
)
{
{
char
*
psz_option
;
char
*
psz_option
;
asprintf
(
&
psz_option
,
"rtsp-caching=5000"
);
if
(
asprintf
(
&
psz_option
,
"rtsp-caching=5000"
)
!=
-
1
)
{
input_item_AddOption
(
p_child
,
psz_option
);
input_item_AddOption
(
p_child
,
psz_option
);
free
(
psz_option
);
free
(
psz_option
);
}
}
}
if
(
!
p_sys
->
psz_mcast_ip
&&
p_sys
->
b_rtsp_kasenna
)
if
(
!
p_sys
->
psz_mcast_ip
&&
p_sys
->
b_rtsp_kasenna
)
{
{
char
*
psz_option
;
char
*
psz_option
;
asprintf
(
&
psz_option
,
"rtsp-kasenna"
);
if
(
asprintf
(
&
psz_option
,
"rtsp-kasenna"
)
!=
-
1
)
{
input_item_AddOption
(
p_child
,
psz_option
);
input_item_AddOption
(
p_child
,
psz_option
);
free
(
psz_option
);
free
(
psz_option
);
}
}
}
input_item_AddSubItem
(
p_current_input
,
p_child
);
input_item_AddSubItem
(
p_current_input
,
p_child
);
vlc_gc_decref
(
p_child
);
vlc_gc_decref
(
p_child
);
...
...
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