From a483173c78fb453b73308a9b44ce54fb3878ed0e Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Tue, 10 Jan 2017 15:33:57 -0800 Subject: [PATCH] Fix a use-of-uninitialized-value warning. This warning was generated by the static analyzer: warning: The left expression of the compound assignment is an uninitialized value. The computed value will also be garbage *mDirtyMask |= animator->dirtyMask(); This can be fixed by initializing dirtyMask before using it in AnimateFunctor. Bug: None Test: Static analyzer no longer complains about this. Change-Id: I892749079cf93a012f1bed059a3f0c8bbaed9d7e --- libs/hwui/AnimatorManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hwui/AnimatorManager.cpp b/libs/hwui/AnimatorManager.cpp index 9d5860ca0d1a0..f5bb821f4e239 100644 --- a/libs/hwui/AnimatorManager.cpp +++ b/libs/hwui/AnimatorManager.cpp @@ -142,7 +142,7 @@ void AnimatorManager::animateNoDamage(TreeInfo& info) { } uint32_t AnimatorManager::animateCommon(TreeInfo& info) { - uint32_t dirtyMask; + uint32_t dirtyMask = 0; AnimateFunctor functor(info, mAnimationHandle->context(), &dirtyMask); auto newEnd = std::remove_if(mAnimators.begin(), mAnimators.end(), functor); mAnimators.erase(newEnd, mAnimators.end());