[3.0] Fixed crash issue by referencing unallocated memory 24/107824/3
authorsuhyung Eom <suhyung.eom@samsung.com>
Fri, 30 Dec 2016 05:39:10 +0000 (14:39 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Fri, 30 Dec 2016 06:23:51 +0000 (15:23 +0900)
Crash was occurred when referencing unallocated memory
Wrong memory of DefaultFont->FindFont was used with condition
(script = TextAbstraction::UNKNOWN and defaultFonts != NULL)

Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: Ifacceb7b6766156c7d3b11d2c2408f57dad2e6ee

dali-toolkit/internal/text/multi-language-support-impl.cpp

index ae9a68b..c803c1d 100644 (file)
@@ -477,7 +477,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
     currentFontId = fontId;
 
     // Get the script for the current character.
-    const Script script = GetScript( index,
+    Script script = GetScript( index,
                                      scriptRunIt,
                                      scriptRunEndIt );
 
@@ -494,6 +494,10 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
                      description.path.c_str() );
     }
 #endif
+    if (script == TextAbstraction::UNKNOWN)
+    {
+      script = TextAbstraction::LATIN;
+    }
 
     // Validate whether the current character is supported by the given font.
     bool isValidFont = false;