[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] protocol/rtsp crtspbase.cpp,1.107,1.108
From:       ryuan () helixcommunity ! org
Date:       2012-08-30 10:33:34
[Download RAW message or body]

Update of /cvsroot/server/protocol/rtsp
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv16073

Modified Files:
	crtspbase.cpp 
Log Message:
Synopsis:
=========
Fixes Bug 270656 Uptime: CAs in CRTSPBaseProtocol::AddSession() and \
CRTSPBaseProtocol::AddSession() after start the RTSP clients

Branches: SERVER_15_0, head
Suggested Reviewers: James, Xiaocheng and Anyone

Description:
============
Refer the bug description.

Fix:
Add some check in the function to avoid CA.

Files affected:
===============
server/protocol/rtsp/crtspbase.cpp

Testing Performed:
================
Unit Tests:
LCT test.

Integration Tests:
None

Leak Tests: None
Performance Tests: N/A

Platforms Tested: win-x86_64-vc10.
Builds Verified: win-x86_64-vc10.

QA Hints
========
None.



Index: crtspbase.cpp
===================================================================
RCS file: /cvsroot/server/protocol/rtsp/crtspbase.cpp,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -d -r1.107 -r1.108
--- crtspbase.cpp	28 Aug 2012 02:52:20 -0000	1.107
+++ crtspbase.cpp	30 Aug 2012 10:33:27 -0000	1.108
@@ -5144,9 +5144,29 @@
     {
         IHXSockAddr* pLocalAddr = NULL;
         IHXBuffer* pLocalAddrBuf = NULL;
-        m_pSock->GetLocalAddr(&pLocalAddr);
-        pLocalAddr->GetAddr(&pLocalAddrBuf);
-        pPlaySession->init_stats(pLocalAddrBuf);
+        if(m_pSock)
+        {
+            m_pSock->GetLocalAddr(&pLocalAddr);
+        }
+        
+        if(pLocalAddr)
+        {
+            pLocalAddr->GetAddr(&pLocalAddrBuf);
+        }        
+
+        if(pLocalAddrBuf)
+        {
+            pPlaySession->init_stats(pLocalAddrBuf);
+        }
+        else
+        {
+            m_pClient->RemoveSession(sessionID, HXR_FAIL);
+            HX_RELEASE(pPlaySession);
+            HX_RELEASE(pLocalAddrBuf);
+            HX_RELEASE(pLocalAddr);
+            return HXR_UNEXPECTED;
+        }
+        
         HX_RELEASE(pLocalAddrBuf);
         HX_RELEASE(pLocalAddr);
     }
@@ -8515,9 +8535,12 @@
                 pInfo->m_ulControlID = streamNumber;
             }
 
-            pSession->m_ppStreamInfo[streamNumber] = pInfo;
+            if(streamNumber < pSession->m_uStreamCount)
+            {
+                pSession->m_ppStreamInfo[streamNumber] = pInfo;
 
-            pSession->m_punNumASMRules[streamNumber] = unNumRules;
+                pSession->m_punNumASMRules[streamNumber] = unNumRules;
+            }
 
             if(ulDuration > ulMaxStreamDuration)
             {
@@ -8533,11 +8556,14 @@
             }
         }
 
-        for(int istr = 0; istr < streamNumber; istr++)
+        if(streamNumber < pSession->m_uStreamCount)
         {
-            _RTSPStreamInfo *currStream = pSession->m_ppStreamInfo[istr];
-            m_ControlIDMap[currStream->m_ulControlID] = (void*)
-                    \
pSession->m_ppStreamInfo[pMaxBitrate[currStream->m_uStreamGroupNumber]]->m_ulControlID;
 +            for(int istr = 0; istr < streamNumber; istr++)
+            {
+                _RTSPStreamInfo *currStream = pSession->m_ppStreamInfo[istr];
+                m_ControlIDMap[currStream->m_ulControlID] = (void*)
+                        \
pSession->m_ppStreamInfo[pMaxBitrate[currStream->m_uStreamGroupNumber]]->m_ulControlID;
 +            }
         }
         delete[] pMaxBitrate;
 


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic