From 8a29c4aa3e48a7f84529f1672f8b714d8679611e Mon Sep 17 00:00:00 2001 From: hyc Date: Tue, 10 Nov 2009 11:00:55 +0000 Subject: [PATCH] Fix double-free, uninit'd vars git-svn-id: svn://svn.mplayerhq.hu/rtmpdump@41 400ebc74-4327-4243-bc38-086b20814532 --- rtmp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rtmp.cpp b/rtmp.cpp index 1342d7d..f88dbde 100644 --- a/rtmp.cpp +++ b/rtmp.cpp @@ -94,6 +94,11 @@ char RTMPProtocolStringsLower[][7] = CRTMP::CRTMP() : m_socket(0) { + for (int i=0; i<65600; i++) + { + m_vecChannelsIn[i] = NULL; + m_vecChannelsOut[i] = NULL; + } Close(); m_pBuffer = new char[RTMP_BUFFER_CACHE_SIZE]; m_nBufferMS = 300; @@ -104,6 +109,7 @@ CRTMP::CRTMP() : m_socket(0) m_fVideoCodecs = 252.0; m_bTimedout = false; m_bPausing = 0; + m_mediaChannel = 0; } CRTMP::~CRTMP() @@ -1481,6 +1487,7 @@ bool CRTMP::ReadPacket(RTMPPacket &packet) { Log(LOGERROR, "%s, failed to read RTMP packet body. len: %lu", __FUNCTION__, packet.m_nBodySize); packet.m_body = NULL; // we dont want it deleted since its pointed to from the stored packets (m_vecChannelsIn) + packet.m_buffer = NULL; return false; } -- 2.40.0