Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
5263f464
Commit
5263f464
authored
Feb 20, 2017
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp: Lazily allocate the pollfd array
And use av_malloc_array.
parent
b9b82151
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
rtsp.c
libavformat/rtsp.c
+6
-3
No files found.
libavformat/rtsp.c
View file @
5263f464
...
...
@@ -662,7 +662,6 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1,
int
ff_sdp_parse
(
AVFormatContext
*
s
,
const
char
*
content
)
{
RTSPState
*
rt
=
s
->
priv_data
;
const
char
*
p
;
int
letter
,
i
;
/* Some SDP lines, particularly for Realmedia or ASF RTSP streams,
...
...
@@ -709,8 +708,6 @@ int ff_sdp_parse(AVFormatContext *s, const char *content)
av_free
(
s1
->
default_exclude_source_addrs
[
i
]);
av_freep
(
&
s1
->
default_exclude_source_addrs
);
rt
->
p
=
av_malloc
(
sizeof
(
struct
pollfd
)
*
2
*
(
rt
->
nb_rtsp_streams
+
1
));
if
(
!
rt
->
p
)
return
AVERROR
(
ENOMEM
);
return
0
;
}
#endif
/* CONFIG_RTPDEC */
...
...
@@ -1920,6 +1917,12 @@ static int udp_read_packet(AVFormatContext *s, RTSPStream **prtsp_st,
struct
pollfd
*
p
=
rt
->
p
;
int
*
fds
=
NULL
,
fdsnum
,
fdsidx
;
if
(
!
p
)
{
p
=
rt
->
p
=
av_malloc_array
(
2
*
(
rt
->
nb_rtsp_streams
+
1
),
sizeof
(
struct
pollfd
));
if
(
!
p
)
return
AVERROR
(
ENOMEM
);
}
if
(
rt
->
rtsp_hd
)
{
tcp_fd
=
ffurl_get_file_handle
(
rt
->
rtsp_hd
);
p
[
max_p
].
fd
=
tcp_fd
;
...
...
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