From 2a1da7fe284f99d546a3aaf08b231860085837dd Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 7 Mar 2018 10:56:38 +0900 Subject: [PATCH] Fix SVACE issue - Initialized mTtsHandle in tts-player-impl-tizen.cpp - NULL check at glyphy-acrs.cc:62 Change-Id: I4ec96b53e3f8befaffecef6c281a316df9f14ece Signed-off-by: Seoyeon Kim --- adaptors/tizen/tts-player-impl-tizen.cpp | 1 + text/dali/internal/glyphy/glyphy-arcs.cc | 20 ++++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/adaptors/tizen/tts-player-impl-tizen.cpp b/adaptors/tizen/tts-player-impl-tizen.cpp index 9b9a2c6..ef18599 100644 --- a/adaptors/tizen/tts-player-impl-tizen.cpp +++ b/adaptors/tizen/tts-player-impl-tizen.cpp @@ -83,6 +83,7 @@ Dali::TtsPlayer TtsPlayer::New(Dali::TtsPlayer::Mode mode) TtsPlayer::TtsPlayer(Dali::TtsPlayer::Mode mode) : mInitialized(false), mUnplayedString(""), + mTtsHandle(), mUtteranceId(0), mTtsMode(mode) { diff --git a/text/dali/internal/glyphy/glyphy-arcs.cc b/text/dali/internal/glyphy/glyphy-arcs.cc index 35b4228..8e42194 100644 --- a/text/dali/internal/glyphy/glyphy-arcs.cc +++ b/text/dali/internal/glyphy/glyphy-arcs.cc @@ -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; } -- 2.7.4