# HG changeset patch # User Pat Downey # Date 1288104761 -3600 # Node ID c38f396e1cd042836f63bfa2a79b273f4e728b18 # Parent c1bd57533c56f35060f35189fac725eca205efe7# Parent b72c2d56e34ae2bc07379e4b275551f7ca77903e Re-merge foundation certs(Bug 1993) and fix for Bug 2121. diff -r b72c2d56e34a -r c38f396e1cd0 commondrm/drmrightsmanagerui/src/DRMRightsMgrAppUi.cpp diff -r b72c2d56e34a -r c38f396e1cd0 commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsView.cpp --- a/commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsView.cpp Fri Sep 17 17:32:40 2010 +0100 +++ b/commondrm/drmrightsmanagerui/src/DRMRightsMgrDetailsView.cpp Tue Oct 26 15:52:41 2010 +0100 @@ -437,6 +437,7 @@ iDetails.iIndividualConstraint = aIndividualConstraint; iDetails.iUsageAllowed = aUsageAllowed; iDetails.iActiveROindex = 0; + DeleteConstraints(); iDetails.iRights->Reset(); iDetails.iDrmScheme = aDrmScheme; diff -r b72c2d56e34a -r c38f396e1cd0 commondrm/drmutility/src/DrmUiHandlingImpl.cpp --- a/commondrm/drmutility/src/DrmUiHandlingImpl.cpp Fri Sep 17 17:32:40 2010 +0100 +++ b/commondrm/drmutility/src/DrmUiHandlingImpl.cpp Tue Oct 26 15:52:41 2010 +0100 @@ -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 b72c2d56e34a -r c38f396e1cd0 commondrm/drmutility/src/DrmUtility.cpp --- a/commondrm/drmutility/src/DrmUtility.cpp Fri Sep 17 17:32:40 2010 +0100 +++ b/commondrm/drmutility/src/DrmUtility.cpp Tue Oct 26 15:52:41 2010 +0100 @@ -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 b72c2d56e34a -r c38f396e1cd0 commondrm/drmutility/src/drmutilitywmdrmwrapper.cpp --- a/commondrm/drmutility/src/drmutilitywmdrmwrapper.cpp Fri Sep 17 17:32:40 2010 +0100 +++ b/commondrm/drmutility/src/drmutilitywmdrmwrapper.cpp Tue Oct 26 15:52:41 2010 +0100 @@ -598,7 +598,7 @@ // call given HandleErrorObserver if( value > 0 ) { - aObserver->RightsAvailable( aOperationId, KErrNone ); + CallRightsAvailable( aObserver, aOperationId, KErrNone ); } } CleanupStack::PopAndDestroy( &file ); diff -r b72c2d56e34a -r c38f396e1cd0 drm_plat/drm_common_api/tsrc/data/mmc/DRM/content.dcf diff -r b72c2d56e34a -r c38f396e1cd0 drm_plat/drm_rights_api/tsrc/data/c/content.dcf diff -r b72c2d56e34a -r c38f396e1cd0 drm_pub/oma_drm_caf_agent_api/tsrc/bc/DRM_CAF/data/content.dcf diff -r b72c2d56e34a -r c38f396e1cd0 omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp --- a/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Fri Sep 17 17:32:40 2010 +0100 +++ b/omadrm/drmengine/agentv2/src/Oma2AgentAttributes.cpp Tue Oct 26 15:52:41 2010 +0100 @@ -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 b72c2d56e34a -r c38f396e1cd0 omadrm/drmengine/roap/src/RoapEng.cpp --- a/omadrm/drmengine/roap/src/RoapEng.cpp Fri Sep 17 17:32:40 2010 +0100 +++ b/omadrm/drmengine/roap/src/RoapEng.cpp Tue Oct 26 15:52:41 2010 +0100 @@ -32,7 +32,7 @@ #ifndef __WINS__ #include #include -#include +#include #endif #include