From: Seoyeon Kim Date: Wed, 7 Mar 2018 01:56:38 +0000 (+0900) Subject: Fix SVACE issue X-Git-Tag: accepted/tizen/4.0/unified/20190104.230754~1 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=2a1da7fe284f99d546a3aaf08b231860085837dd 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 --- 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; }