diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-01-22 15:50:48 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-03 02:21:55 +0100 |
commit | 7620d48f2eab67812d8c535d12a98eaa754a1177 (patch) | |
tree | fa54495c95ff5b4c0b6fa991124dc78e90732646 /libavformat/network.c | |
parent | 9d7ae72725e16bc4b53ed6ccedf86d0ae2853809 (diff) | |
download | ffmpeg-7620d48f2eab67812d8c535d12a98eaa754a1177.tar.gz |
avformat/network: Check for av_malloc* failures in ff_tls_init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/network.c')
-rw-r--r-- | libavformat/network.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/network.c b/libavformat/network.c index 9f02ec6c51..e9eab297e2 100644 --- a/libavformat/network.c +++ b/libavformat/network.c @@ -66,7 +66,7 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL; #endif #endif -void ff_tls_init(void) +int ff_tls_init(void) { avpriv_lock_avformat(); #if CONFIG_OPENSSL @@ -77,6 +77,8 @@ void ff_tls_init(void) if (!CRYPTO_get_locking_callback()) { int i; 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++) pthread_mutex_init(&openssl_mutexes[i], NULL); CRYPTO_set_locking_callback(openssl_lock); @@ -96,6 +98,8 @@ void ff_tls_init(void) gnutls_global_init(); #endif avpriv_unlock_avformat(); + + return 0; } void ff_tls_deinit(void) |