Fix VD prevent issues - DIVIDE_BY_ZERO 01/46801/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 26 Aug 2015 07:53:01 +0000 (16:53 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 26 Aug 2015 08:18:29 +0000 (17:18 +0900)
Change-Id: Iceb219087a98082fa36e40a4f1701b17c7105c57

dali/internal/event/animation/path-impl.cpp
dali/internal/event/common/property-buffer-impl.cpp

index 540bc29..ad1c796 100644 (file)
@@ -308,7 +308,7 @@ void Path::FindSegmentAndProgress( float t, unsigned int& segment, float& tLocal
   //Find segment and local progress
   unsigned int numSegs = GetNumberOfSegments();
 
-  if( t <= 0.0f )
+  if( t <= 0.0f || numSegs == 0 )
   {
     segment = 0;
     tLocal = 0.0f;
index 7fa13f7..384e136 100644 (file)
@@ -88,7 +88,7 @@ unsigned int GetPropertyImplementationAlignment( Property::Type& propertyType )
     case Property::ARRAY:
     case Property::MAP:
     {
-      DALI_ASSERT_ALWAYS( "No size for properties with no type, or dynamic sizes" );
+      DALI_ASSERT_ALWAYS( false && "No size for properties with no type, or dynamic sizes" );
       break;
     }
     case Property::BOOLEAN:
@@ -446,10 +446,13 @@ void PropertyBuffer::FormatChanged()
   }
 
   // Check the alignment for the maxAlignment required to calculate the size of the format
-  if( unsigned int offset = currentAlignment % maxAlignmentRequired )
+  if( maxAlignmentRequired != 0 )
   {
-    // Not compatible, realign
-    currentAlignment = currentAlignment + maxAlignmentRequired - offset;
+    if( unsigned int offset = currentAlignment % maxAlignmentRequired )
+    {
+      // Not compatible, realign
+      currentAlignment = currentAlignment + maxAlignmentRequired - offset;
+    }
   }
 
   // Set the format size