Fix SVACE issue 20/171720/3
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Wed, 7 Mar 2018 01:56:38 +0000 (10:56 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Thu, 15 Mar 2018 05:31:56 +0000 (14:31 +0900)
- Initialized mTtsHandle in tts-player-impl-tizen.cpp
- NULL check at glyphy-acrs.cc:62

Change-Id: I4ec96b53e3f8befaffecef6c281a316df9f14ece
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/internal/accessibility/tizen-common/tts-player-impl-tizen.cpp
third-party/glyphy/glyphy-arcs.cc

index 7b3a689..a6974eb 100644 (file)
@@ -80,6 +80,7 @@ std::unique_ptr<TtsPlayerTizen> TtsPlayerTizen::New(Dali::TtsPlayer::Mode mode)
 TtsPlayerTizen::TtsPlayerTizen(Dali::TtsPlayer::Mode mode)
 : mInitialized(false),
   mUnplayedString(""),
+  mTtsHandle(),
   mUtteranceId(0),
   mTtsMode(mode)
 {
index 35b4228..8e42194 100644 (file)
@@ -59,14 +59,22 @@ glyphy_arc_accumulator_t *
 glyphy_arc_accumulator_create (void)
 {
   glyphy_arc_accumulator_t *acc = (glyphy_arc_accumulator_t *) calloc (1, sizeof (glyphy_arc_accumulator_t));
-  acc->refcount = 1;
 
-  acc->tolerance = 5e-4;
-  acc->d_bits = 8;
-  acc->callback = NULL;
-  acc->user_data = NULL;
+  /**
+   * In the original file, a pointer 'acc' returned from 'calloc' may be NULL, and it is dereferenced.
+   * To prevent Null Pointer Dereference, we add to check NULL value here.
+   */
+  if( acc )
+  {
+    acc->refcount = 1;
 
-  glyphy_arc_accumulator_reset (acc);
+    acc->tolerance = 5e-4;
+    acc->d_bits = 8;
+    acc->callback = NULL;
+    acc->user_data = NULL;
+
+    glyphy_arc_accumulator_reset (acc);
+  }
 
   return acc;
 }