Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
7620d48f
Commit
7620d48f
authored
Jan 22, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/network: Check for av_malloc* failures in ff_tls_init()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
9d7ae727
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
4 deletions
+10
-4
network.c
libavformat/network.c
+5
-1
network.h
libavformat/network.h
+1
-1
tls.c
libavformat/tls.c
+2
-1
utils.c
libavformat/utils.c
+2
-1
No files found.
libavformat/network.c
View file @
7620d48f
...
@@ -66,7 +66,7 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
...
@@ -66,7 +66,7 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
#endif
#endif
#endif
#endif
void
ff_tls_init
(
void
)
int
ff_tls_init
(
void
)
{
{
avpriv_lock_avformat
();
avpriv_lock_avformat
();
#if CONFIG_OPENSSL
#if CONFIG_OPENSSL
...
@@ -77,6 +77,8 @@ void ff_tls_init(void)
...
@@ -77,6 +77,8 @@ void ff_tls_init(void)
if
(
!
CRYPTO_get_locking_callback
())
{
if
(
!
CRYPTO_get_locking_callback
())
{
int
i
;
int
i
;
openssl_mutexes
=
av_malloc_array
(
sizeof
(
pthread_mutex_t
),
CRYPTO_num_locks
());
openssl_mutexes
=
av_malloc_array
(
sizeof
(
pthread_mutex_t
),
CRYPTO_num_locks
());
if
(
!
openssl_mutexes
)
return
AVERROR
(
ENOMEM
);
for
(
i
=
0
;
i
<
CRYPTO_num_locks
();
i
++
)
for
(
i
=
0
;
i
<
CRYPTO_num_locks
();
i
++
)
pthread_mutex_init
(
&
openssl_mutexes
[
i
],
NULL
);
pthread_mutex_init
(
&
openssl_mutexes
[
i
],
NULL
);
CRYPTO_set_locking_callback
(
openssl_lock
);
CRYPTO_set_locking_callback
(
openssl_lock
);
...
@@ -96,6 +98,8 @@ void ff_tls_init(void)
...
@@ -96,6 +98,8 @@ void ff_tls_init(void)
gnutls_global_init
();
gnutls_global_init
();
#endif
#endif
avpriv_unlock_avformat
();
avpriv_unlock_avformat
();
return
0
;
}
}
void
ff_tls_deinit
(
void
)
void
ff_tls_deinit
(
void
)
...
...
libavformat/network.h
View file @
7620d48f
...
@@ -78,7 +78,7 @@ extern int ff_network_inited_globally;
...
@@ -78,7 +78,7 @@ extern int ff_network_inited_globally;
int
ff_network_init
(
void
);
int
ff_network_init
(
void
);
void
ff_network_close
(
void
);
void
ff_network_close
(
void
);
void
ff_tls_init
(
void
);
int
ff_tls_init
(
void
);
void
ff_tls_deinit
(
void
);
void
ff_tls_deinit
(
void
);
int
ff_network_wait_fd
(
int
fd
,
int
write
);
int
ff_network_wait_fd
(
int
fd
,
int
write
);
...
...
libavformat/tls.c
View file @
7620d48f
...
@@ -175,7 +175,8 @@ static int tls_open(URLContext *h, const char *uri, int flags)
...
@@ -175,7 +175,8 @@ static int tls_open(URLContext *h, const char *uri, int flags)
const
char
*
proxy_path
;
const
char
*
proxy_path
;
int
use_proxy
;
int
use_proxy
;
ff_tls_init
();
if
((
ret
=
ff_tls_init
())
<
0
)
return
ret
;
if
(
c
->
listen
)
if
(
c
->
listen
)
snprintf
(
opts
,
sizeof
(
opts
),
"?listen=1"
);
snprintf
(
opts
,
sizeof
(
opts
),
"?listen=1"
);
...
...
libavformat/utils.c
View file @
7620d48f
...
@@ -4095,7 +4095,8 @@ int avformat_network_init(void)
...
@@ -4095,7 +4095,8 @@ int avformat_network_init(void)
ff_network_inited_globally
=
1
;
ff_network_inited_globally
=
1
;
if
((
ret
=
ff_network_init
())
<
0
)
if
((
ret
=
ff_network_init
())
<
0
)
return
ret
;
return
ret
;
ff_tls_init
();
if
((
ret
=
ff_tls_init
())
<
0
)
return
ret
;
#endif
#endif
return
0
;
return
0
;
}
}
...
...
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