From: Nicholas Guriev Date: Thu, 27 May 2021 12:01:58 +0000 (+0300) Subject: Fix dereferencing of null pointer in model::Layer::solidColor() getter X-Git-Tag: submit/tizen/20210621.044901~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ebe1aa7b5f8091750049dac7ed1e44c31a6618c;p=platform%2Fcore%2Fuifw%2Flottie-player.git Fix dereferencing of null pointer in model::Layer::solidColor() getter Also remove unnecessarily check of mExtra->mAsset in the asset() getter. Change-Id: Ic17532314309e331be28bd09d9af63208ac0690b --- diff --git a/src/lottie/lottiemodel.h b/src/lottie/lottiemodel.h index 977e808..c6b8cf6 100644 --- a/src/lottie/lottiemodel.h +++ b/src/lottie/lottiemodel.h @@ -687,7 +687,10 @@ public: int inFrame() const noexcept { return mInFrame; } int outFrame() const noexcept { return mOutFrame; } int startFrame() const noexcept { return mStartFrame; } - Color solidColor() const noexcept { return mExtra->mSolidColor; } + Color solidColor() const noexcept + { + return mExtra ? mExtra->mSolidColor : Color(); + } bool autoOrient() const noexcept { return mAutoOrient; } int timeRemap(int frameNo) const; VSize layerSize() const { return mLayerSize; } @@ -701,10 +704,7 @@ public: { return mTransform ? mTransform->opacity(frameNo) : 1.0f; } - Asset *asset() const - { - return (mExtra && mExtra->mAsset) ? mExtra->mAsset : nullptr; - } + Asset *asset() const { return mExtra ? mExtra->mAsset : nullptr; } struct Extra { Color mSolidColor; std::string mPreCompRefId;