fixed prevent in font(Null pointer check)
authorSungyeon Woo <s.woo@samsung.com>
Thu, 2 May 2013 00:01:47 +0000 (09:01 +0900)
committerSungyeon Woo <s.woo@samsung.com>
Thu, 2 May 2013 00:04:26 +0000 (09:04 +0900)
Change-Id: I477ba45006cd591d549d1a7ffb49f5a5e8e41878
Signed-off-by: Sungyeon Woo <s.woo@samsung.com>
src/graphics/FGrp_FontBidiUtil.cpp

index 0033154..6411b4f 100644 (file)
@@ -280,28 +280,28 @@ _GetBidiShapeString(BidiParagraph* pBidiProps)
 
                        pTestString = autoDeleteString.get();
                }
-       }
 
-       std::unique_ptr<FriBidiJoiningType[]> pJoinTypes(new (std::nothrow) FriBidiJoiningType[textLength]);
+               std::unique_ptr<FriBidiJoiningType[]> pJoinTypes(new (std::nothrow) FriBidiJoiningType[textLength]);
 
-       if (!pJoinTypes.get())
-       {
-               return pBidiProps->pString;
-       }
+               if (!pJoinTypes.get())
+               {
+                       return pBidiProps->pString;
+               }
 
-       fribidi_get_joining_types(pTestString, textLength, pJoinTypes.get());
+               fribidi_get_joining_types(pTestString, textLength, pJoinTypes.get());
 
-       fribidi_join_arabic(pBidiProps->pCharTypes, textLength, pBidiProps->pEmbeddingLevels, pJoinTypes.get());
+               fribidi_join_arabic(pBidiProps->pCharTypes, textLength, pBidiProps->pEmbeddingLevels, pJoinTypes.get());
 
-       fribidi_shape(FRIBIDI_FLAGS_DEFAULT | FRIBIDI_FLAGS_ARABIC, pBidiProps->pEmbeddingLevels, textLength, pJoinTypes.get(), pTestString);
+               fribidi_shape(FRIBIDI_FLAGS_DEFAULT | FRIBIDI_FLAGS_ARABIC, pBidiProps->pEmbeddingLevels, textLength, pJoinTypes.get(), pTestString);
 
-       if (sizeof(wchar_t) == sizeof(FriBidiChar))
-       {
-               pBidiProps->pString = (wchar_t *) pTestString;
-       }
-       else
-       {
-               _ConvertCharacterCode<wchar_t, FriBidiChar>(pBidiProps->pString, pTestString, textLength);
+               if (sizeof(wchar_t) == sizeof(FriBidiChar))
+               {
+                       pBidiProps->pString = (wchar_t *) pTestString;
+               }
+               else
+               {
+                       _ConvertCharacterCode<wchar_t, FriBidiChar>(pBidiProps->pString, pTestString, textLength);
+               }
        }
 
        return pBidiProps->pString;