[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-clientapps-cvs
Subject: [Clientapps-cvs] symbianMmf/audiocontroller hxmmfaudioctrl.cpp,
From: anuj_dhamija () helixcommunity ! org
Date: 2008-02-06 20:01:58
Message-ID: 200802062002.m16K2WpU026571 () mailer ! progressive-comp ! com
[Download RAW message or body]
Update of /cvsroot/clientapps/symbianMmf/audiocontroller
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv25994
Modified Files:
Tag: hxclient_2_2_1_cayennes
hxmmfaudioctrl.cpp
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement with \
RealNetworks, and I am authorized to contribute this code under said agreement."
Modified by: ext-anuj.dhamija@nokia.com
Date: 02/05/2008
Project: SymbianMmf_rel
Synopsis: Playing an Invalid/Corrupt/Unsupported Audio File with Helix Audio \
Controller causes Helix to crash.
Overview:
Inside CHXAudioController::AddDataSourceL method m_pDataSource is initialized to \
instance of CASynchronousMultiReader which internally creates an object of \
CASynchronousReader wherein address of the reference to the source (passed as \
argument of AddDataSourceL) method is stored. Since file is not supported, \
AddDataSourceL function leaves with call to User::Leave causing trap at Framework \
(CMMFController). On getting error, Framework deletes the source as part of deletion \
of CMMFDataSourceHolder object. This causes the pointer to this source inside \
CASynchronousReader object to become dangling. Consequent call to the destructor of \
CASynchronousReader object (as part of releasing of resources) causes the crash when \
this pointer is used to access some member method (SinkThreadLogoff method of \
CMMFClip).
Fix:
Before CHXAudioController invokes User::Leave in case of unsuccessful return of \
AddDataSourceL, instruct m_pDataSource to reset the data source pointer to NULL \
across all the components to which the reference is passed. This ensures that no \
further operations on this particular source pointer is performed in following \
cleanup.
Files modified & changes:
\common\fileio\pub\platform\symbian\asynchronousmultireader.h
- New method Close() CAReadingScheduler which further invokes Close method of \
ASynchronousReader object (m_pReader) \
\common\fileio\pub\platform\symbian\asynchronousmultireader.cpp
- CAsynchronousMultiReader::Close() : Invoke Close() method on AReadingScheduler \
instance
- CAsynchronousReader::Close : set CMMFClip instance m_pImpl to NULL
\clientapps\symbianMmf\audiocontrollerhxmmfaudioctrl.cpp
- CHXAudioController::AddDataSourceL(): invoke Close() on m_pDataSource before \
calling User::Leave
Unit Testing:
A) Play an Corrupt/unsupported Real Media Audio file. Message "Invalid Clip" is \
displayed and no crash. B) Play a valid Real Media Audio File. It plays fine.
Image Size and Heap Use impact: None
Module Release testing (STIF, Audio) : Passed
Test case(s) Added : No
Memory leak check performed : Passed, No leaks found
Platforms and Profiles Build Verified: helix-client-s60-32-mmf-mdf-arm
Platforms and Profiles Functionality verified: armv5
Branch: Head, 221Cays & 210CayS
Index: hxmmfaudioctrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp,v
retrieving revision 1.1.2.19
retrieving revision 1.1.2.19.2.1
diff -u -d -r1.1.2.19 -r1.1.2.19.2.1
--- hxmmfaudioctrl.cpp 7 Dec 2007 20:22:22 -0000 1.1.2.19
+++ hxmmfaudioctrl.cpp 6 Feb 2008 20:01:55 -0000 1.1.2.19.2.1
@@ -919,6 +919,16 @@
{
HXLOGL1( HXLOG_SMMF,
"CHXAudioController::AddDataSourceL() Failed : %d", lError);
+
+ //Before control is passed back to Framework as result of Leave
+ //close the data source so as to set the souce pointers to NULL
+ //Framework delets the source on error and setting these to NULL
+ //ensures no cleanup operations are performed when resources are released
+ if(m_pDataSource)
+ {
+ m_pDataSource->Close();
+ }
+
User::Leave(lError);
}
_______________________________________________
Clientapps-cvs mailing list
Clientapps-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/clientapps-cvs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic