[3.0] Prevention of Null pointer dereference 08/71008/1 accepted/tizen/common/20160524.150517 accepted/tizen/ivi/20160525.062203 accepted/tizen/mobile/20160525.062302 accepted/tizen/tv/20160525.062132 accepted/tizen/wearable/20160525.062229 submit/tizen/20160524.015112 submit/tizen/20160525.015808
authorminho.sun <minho.sun@samsung.com>
Wed, 18 May 2016 02:07:31 +0000 (11:07 +0900)
committerminho.sun <minho.sun@samsung.com>
Wed, 18 May 2016 02:07:35 +0000 (11:07 +0900)
This reverts commit fd5557c45975bbab293c1c3793f52672db3a93bb.

Change-Id: I7c72dadd008eee2801909870be122706dce17088

dali/internal/event/common/object-impl.cpp
dali/internal/update/rendering/scene-graph-renderer.cpp

index 7013a10..3e8cc80 100644 (file)
@@ -824,7 +824,7 @@ Property::Value Object::GetPropertyValue( const PropertyMetadata* entry ) const
     {
       case Property::BOOLEAN:
       {
-        const AnimatableProperty<bool>* property = dynamic_cast< const AnimatableProperty<bool>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<bool>* property = static_cast< const AnimatableProperty<bool>* >( 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<int>* property = dynamic_cast< const AnimatableProperty<int>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<int>* property = static_cast< const AnimatableProperty<int>* >( 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<float>* property = dynamic_cast< const AnimatableProperty<float>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<float>* property = static_cast< const AnimatableProperty<float>* >( 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<Vector2>* property = dynamic_cast< const AnimatableProperty<Vector2>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<Vector2>* property = static_cast< const AnimatableProperty<Vector2>* >( 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<Vector3>* property = dynamic_cast< const AnimatableProperty<Vector3>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<Vector3>* property = static_cast< const AnimatableProperty<Vector3>* >( 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<Vector4>* property = dynamic_cast< const AnimatableProperty<Vector4>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<Vector4>* property = static_cast< const AnimatableProperty<Vector4>* >( 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<Matrix>* property = dynamic_cast< const AnimatableProperty<Matrix>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<Matrix>* property = static_cast< const AnimatableProperty<Matrix>* >( 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<Matrix3>* property = dynamic_cast< const AnimatableProperty<Matrix3>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<Matrix3>* property = static_cast< const AnimatableProperty<Matrix3>* >( 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<Quaternion>* property = dynamic_cast< const AnimatableProperty<Quaternion>* >( entry->GetSceneGraphProperty() );
+        const AnimatableProperty<Quaternion>* property = static_cast< const AnimatableProperty<Quaternion>* >( entry->GetSceneGraphProperty() );
         DALI_ASSERT_DEBUG( NULL != property );
 
         value = (*property)[ bufferIndex ];
index f004cc8..df622e7 100644 (file)
@@ -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 )
     {