From: Seoyeon Kim Date: Wed, 11 May 2016 06:49:29 +0000 (+0900) Subject: Prevention of Null pointer dereference X-Git-Tag: dali_1.1.35~8^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F26%2F69226%2F2;p=platform%2Fcore%2Fuifw%2Fdali-core.git Prevention of Null pointer dereference Change-Id: I79d3b9e91ac27eb7eaa4d0174997db1705e3649a Signed-off-by: Seoyeon Kim --- diff --git a/dali/internal/event/common/object-impl.cpp b/dali/internal/event/common/object-impl.cpp index 7013a10..3e8cc80 100644 --- a/dali/internal/event/common/object-impl.cpp +++ b/dali/internal/event/common/object-impl.cpp @@ -824,7 +824,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const { case Property::BOOLEAN: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); value = (*property)[ bufferIndex ]; @@ -833,7 +833,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::INTEGER: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); value = (*property)[ bufferIndex ]; @@ -842,7 +842,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::FLOAT: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); value = (*property)[ bufferIndex ]; @@ -851,7 +851,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::VECTOR2: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); if(entry->componentIndex == 0) @@ -871,7 +871,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::VECTOR3: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); if(entry->componentIndex == 0) @@ -895,7 +895,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::VECTOR4: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); if(entry->componentIndex == 0) @@ -923,7 +923,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::MATRIX: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); value = (*property)[ bufferIndex ]; @@ -932,7 +932,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::MATRIX3: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); value = (*property)[ bufferIndex ]; @@ -941,7 +941,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const case Property::ROTATION: { - const AnimatableProperty* property = dynamic_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); + const AnimatableProperty* property = static_cast< const AnimatableProperty* >( entry->GetSceneGraphProperty() ); DALI_ASSERT_DEBUG( NULL != property ); value = (*property)[ bufferIndex ]; diff --git a/dali/internal/update/rendering/scene-graph-renderer.cpp b/dali/internal/update/rendering/scene-graph-renderer.cpp index f004cc8..df622e7 100644 --- a/dali/internal/update/rendering/scene-graph-renderer.cpp +++ b/dali/internal/update/rendering/scene-graph-renderer.cpp @@ -196,7 +196,11 @@ void Renderer::PrepareRender( BufferIndex updateBufferIndex ) const UniformMap& rendererUniformMap = PropertyOwner::GetUniformMap(); AddMappings( localMap, rendererUniformMap ); - AddMappings( localMap, mShader->GetUniformMap() ); + + if( mShader ) + { + AddMappings( localMap, mShader->GetUniformMap() ); + } } else if( mRegenerateUniformMap == COPY_UNIFORM_MAP ) {