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
d2d2d6a2
Commit
d2d2d6a2
authored
Jun 05, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed badly broken sap parser.
parent
0124c9a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
modules/services_discovery/sap.c
modules/services_discovery/sap.c
+9
-11
No files found.
modules/services_discovery/sap.c
View file @
d2d2d6a2
...
...
@@ -332,6 +332,7 @@ static int OpenDemux( vlc_object_t *p_this )
char
*
psz_sdp
=
NULL
;
sdp_t
*
p_sdp
=
NULL
;
int
errval
=
VLC_EGENERIC
;
size_t
i_len
;
if
(
!
var_CreateGetInteger
(
p_demux
,
"sap-parse"
)
)
{
...
...
@@ -349,14 +350,11 @@ static int OpenDemux( vlc_object_t *p_this )
return
VLC_EGENERIC
;
/* Gather the complete sdp file */
psz_sdp
=
NULL
;
#define SDP_MAX 65536
#define OFFSET 1024
for
(
size_t
buflen
=
0
;
buflen
<
SDP_MAX
;
buflen
+=
OFFSET
)
for
(
i_len
=
0
,
psz_sdp
=
NULL
;
i_len
<
65536
;
)
{
char
*
psz_sdp_new
=
realloc
(
psz_sdp
,
buflen
+
1
);
const
int
i_read_max
=
1024
;
char
*
psz_sdp_new
=
realloc
(
psz_sdp
,
i_len
+
i_read_max
);
size_t
i_read
;
if
(
psz_sdp_new
==
NULL
)
{
errval
=
VLC_ENOMEM
;
...
...
@@ -364,19 +362,19 @@ static int OpenDemux( vlc_object_t *p_this )
}
psz_sdp
=
psz_sdp_new
;
ssize_t
i_read
=
stream_Read
(
p_demux
->
s
,
psz_sdp
+
buflen
,
OFFSET
);
i_read
=
stream_Read
(
p_demux
->
s
,
&
psz_sdp
[
i_len
],
i_read_max
);
if
(
i_read
<
0
)
{
msg_Err
(
p_demux
,
"cannot read SDP"
);
goto
error
;
}
i_len
+=
i_read
;
psz_sdp
[
buflen
+
i_read
]
=
'\0'
;
psz_sdp
[
i_len
]
=
'\0'
;
if
(
i_read
<
OFFSET
)
if
(
i_read
<
i_read_max
)
break
;
// EOF
}
#undef OFFSET
p_sdp
=
ParseSDP
(
VLC_OBJECT
(
p_demux
),
psz_sdp
);
...
...
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