From 47f11650b0649012f8c4173585d2396fe3bdd19f Mon Sep 17 00:00:00 2001 From: hyc Date: Fri, 19 Mar 2010 09:23:26 +0000 Subject: [PATCH] Initialization fixes git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@369 400ebc74-4327-4243-bc38-086b20814532 --- librtmp/dh.h | 4 ++-- librtmp/rtmp.c | 16 +--------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/librtmp/dh.h b/librtmp/dh.h index 980d2b1..3e02312 100644 --- a/librtmp/dh.h +++ b/librtmp/dh.h @@ -219,7 +219,7 @@ DHGenerateKey(MDH *dh) if (!MDH_generate_key(dh)) return 0; - MP_t q1; + MP_t q1 = NULL; MP_gethex(&q1, Q1024, res); assert(res); @@ -276,7 +276,7 @@ static int DHComputeSharedSecretKey(MDH *dh, uint8_t *pubkey, size_t nPubkeyLen, uint8_t *secret) { - MP_t q1, pubkeyBn = NULL; + MP_t q1 = NULL, pubkeyBn = NULL; size_t len; int res; diff --git a/librtmp/rtmp.c b/librtmp/rtmp.c index 61d30f5..ce16284 100644 --- a/librtmp/rtmp.c +++ b/librtmp/rtmp.c @@ -203,28 +203,14 @@ RTMP_TLS_Init() void RTMP_Init(RTMP *r) { - int i; - if (!RTMP_TLS_ctx) RTMP_TLS_Init(); - for (i = 0; i < RTMP_CHANNELS; i++) - { - r->m_vecChannelsIn[i] = NULL; - r->m_vecChannelsOut[i] = NULL; - } + memset(r, 0, sizeof(RTMP)); r->m_sb.sb_socket = -1; - r->m_write.m_body = NULL; - RTMP_Close(r); r->m_nBufferMS = 300; - r->m_fDuration = 0; - r->m_sb.sb_start = NULL; r->m_fAudioCodecs = 3191.0; r->m_fVideoCodecs = 252.0; - r->m_fEncoding = 0.0; - r->m_sb.sb_timedout = false; - r->m_pausing = 0; - r->m_mediaChannel = 0; } double -- 2.50.1