# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1286970683 -10800 # Node ID c1bd57533c56f35060f35189fac725eca205efe7 # Parent e9463401011bec25c90d15b1c7e81161b173db3c Revision: 201039 Kit: 201041 diff -r e9463401011b -r c1bd57533c56 commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp --- a/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp Wed Sep 15 12:30:23 2010 +0300 +++ b/commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp Wed Oct 13 14:51:23 2010 +0300 @@ -35,6 +35,7 @@ #include #include + #include // character conversions @@ -219,10 +220,10 @@ { TChar charCode( aKeyEvent.iCode ); - if ( aKeyEvent.iScanCode == EStdKeyEnter ) + if ( charCode == EKeyEnter ) // Default is to show details { - TInt command = EAknSoftkeyClose; + TInt command = EDRMRightsManagerCmdAppViewDet; HandleCommandL( command ); return EKeyWasConsumed; } @@ -254,10 +255,12 @@ } case EAknSoftkeyClose: { + if (server) { server->NotifyServerExit(EAknSoftkeyClose); } + Exit(); break; } diff -r e9463401011b -r c1bd57533c56 commondrm/drmutility/src/DrmUiHandlingImpl.cpp --- a/commondrm/drmutility/src/DrmUiHandlingImpl.cpp Wed Sep 15 12:30:23 2010 +0300 +++ b/commondrm/drmutility/src/DrmUiHandlingImpl.cpp Wed Oct 13 14:51:23 2010 +0300 @@ -389,6 +389,10 @@ { DRM::CDrmUiHandlingData* data( PopFront() ); + // reset the current observer + // it may already be deleted so don't do any calls to it. + iObserver = NULL; + // Empty the queue: while ( data ) { @@ -1126,17 +1130,26 @@ break; } - // Complete the client request - iObserver->OperationCompleted( iOperationId, KErrNone ); - + // if the observer exists and it has not been deleted, call complete + // for the operation and get ready for another round + // this should prevent crashes in case the class is deleted before + // and operation finihes. + + if( iObserver && reinterpret_cast(iObserver) != 0xDEDEDEDE ) + { + // Complete the client request + iObserver->OperationCompleted( iOperationId, KErrNone ); + + // Get ready for another round: + SetActive(); + + // complete internal request: + User::RequestComplete( status, KErrNone ); + } + // destroy the object: CleanupStack::PopAndDestroy( data ); - // Get ready for another round: - SetActive(); - - // complete internal request: - User::RequestComplete( status, KErrNone ); } // ----------------------------------------------------------------------------- diff -r e9463401011b -r c1bd57533c56 commondrm/drmutility/src/DrmUtility.cpp --- a/commondrm/drmutility/src/DrmUtility.cpp Wed Sep 15 12:30:23 2010 +0300 +++ b/commondrm/drmutility/src/DrmUtility.cpp Wed Oct 13 14:51:23 2010 +0300 @@ -215,6 +215,7 @@ TInt64 headerSize( 0 ); TBool isDrmFile( EFalse ); TPtr8 headerPtr( NULL, 0 ); + TInt dataLength = 0; aProtected = DRM::EUUnprotected; aAgent.Set( KNullDesC ); @@ -306,11 +307,17 @@ { // set the mimetype from the buffer which is in the beginning // starting from byte 3 with the length specified at position 2 - TPtrC8 mimeType( buffer->Des().Mid(3, (buffer->Des())[1]) ); - if( !mimeType.CompareF( *iOmaBasedMimeType ) ) - { - aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName ); - isDrmFile = ETrue; + // also make sure the data length is greater or equal to the + // position + the 2nd byte of the content + dataLength = 3 + (buffer->Des())[1]; + if( buffer->Length() >= dataLength ) + { + TPtrC8 mimeType( buffer->Des().Mid(3, (buffer->Des())[1]) ); + if( !mimeType.CompareF( *iOmaBasedMimeType ) ) + { + aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName ); + isDrmFile = ETrue; + } } } CleanupStack::PopAndDestroy( buffer ); @@ -333,6 +340,7 @@ TPtr8 asfPtr( NULL, 0 ); TBuf8< 32 > asfGuidHex; TBool isDrmFile( EFalse ); + TInt dataLength = 0; aProtected = DRM::EUUnprotected; aAgent.Set( KNullDesC ); @@ -401,12 +409,18 @@ { // set the mimetype from the buffer which is in the beginning // starting from byte 3 with the length specified at position 2 - TPtrC8 mimeType( aContent.Mid(3, (aContent)[1]) ); - if( !mimeType.CompareF( *iOmaBasedMimeType ) ) + // also make sure the data length is greater or equal to the + // position + the 2nd byte of the content + dataLength = 3 + (aContent)[1]; + if( aContent.Length() >= dataLength ) { - aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName ); - isDrmFile = ETrue; - aProtected = DRM::EUProtected; + TPtrC8 mimeType( aContent.Mid(3, (aContent)[1]) ); + if( !mimeType.CompareF( *iOmaBasedMimeType ) ) + { + aAgent.Set( *DRM::CDrmUtility::iOmaBasedAgentName ); + isDrmFile = ETrue; + aProtected = DRM::EUProtected; + } } } } diff -r e9463401011b -r c1bd57533c56 drm_plat/drm_common_api/tsrc/data/mmc/DRM/content.dcf diff -r e9463401011b -r c1bd57533c56 drm_plat/drm_rights_api/tsrc/data/c/content.dcf diff -r e9463401011b -r c1bd57533c56 drm_pub/oma_drm_caf_agent_api/tsrc/bc/DRM_CAF/data/content.dcf diff -r e9463401011b -r c1bd57533c56 omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp --- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Wed Sep 15 12:30:23 2010 +0300 +++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Wed Oct 13 14:51:23 2010 +0300 @@ -469,7 +469,9 @@ DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter | - DRM::EDrmAllowAudioUsb; + DRM::EDrmAllowAudioUsb | + DRM::EDrmAllowAudioHdmiHdcpRequired | + DRM::EDrmAllowVideoHdmiHdcpRequired; } else { @@ -712,7 +714,9 @@ DRM::EDrmAllowAudioBluetooth | DRM::EDrmAllowVideoMacroVision | DRM::EDrmAllowAudioFmTransmitter | - DRM::EDrmAllowAudioUsb; + DRM::EDrmAllowAudioUsb | + DRM::EDrmAllowAudioHdmiHdcpRequired | + DRM::EDrmAllowVideoHdmiHdcpRequired; } else { diff -r e9463401011b -r c1bd57533c56 omadrm/drmengine/roap/src/RoapEng.cpp --- a/omadrm/drmengine/roap/src/RoapEng.cpp Wed Sep 15 12:30:23 2010 +0300 +++ b/omadrm/drmengine/roap/src/RoapEng.cpp Wed Oct 13 14:51:23 2010 +0300 @@ -32,7 +32,7 @@ #ifndef __WINS__ #include #include -#include +#include #endif #include