Bug 1389988 Part 1: Prevent AnimationState::UpdateStateInternal from repeatedly setting mIsCurrentlyDecoded true every frame; avoiding race condition.
MozReview-Commit-ID: LDbCtJD6u3N
--- a/image/FrameAnimator.cpp
+++ b/image/FrameAnimator.cpp
@@ -63,24 +63,22 @@ AnimationState::UpdateStateInternal(Look
mDiscarded = false;
mHasRequestedDecode = true;
// If mHasBeenDecoded is true then we know the true total frame count and
// we can use it to determine if we have all the frames now so we know if
// we are currently fully decoded.
// If mHasBeenDecoded is false then we'll get another UpdateState call
// when the decode finishes.
- if (mHasBeenDecoded) {
+ if (mHasBeenDecoded && !mIsCurrentlyDecoded) {
Maybe<uint32_t> frameCount = FrameCount();
MOZ_ASSERT(frameCount.isSome());
if (NS_SUCCEEDED(aResult.Surface().Seek(*frameCount - 1)) &&
aResult.Surface()->IsFinished()) {
mIsCurrentlyDecoded = true;
- } else {
- mIsCurrentlyDecoded = false;
}
}
}
gfx::IntRect ret;
if (aAllowInvalidation) {
// Update the value of mCompositedFrameInvalid.