diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index 3d7c2e784f5d..a00efc27eab6 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -616,19 +616,18 @@ RasterImage::AdvanceFrame(TimeStamp aTime, nsIntRect* aDirtyRect) // something went wrong, move on to next NS_WARNING("RasterImage::AdvanceFrame(): Compositing of frame failed"); nextFrame->SetCompositingFailed(true); + mAnim->currentAnimationFrameTime = GetCurrentImgFrameEndTime(); mAnim->currentAnimationFrameIndex = nextFrameIndex; - mAnim->currentAnimationFrameTime = mAnim->currentAnimationFrameTime + - TimeDuration::FromMilliseconds(timeout); return false; } nextFrame->SetCompositingFailed(false); } + mAnim->currentAnimationFrameTime = GetCurrentImgFrameEndTime(); + // Set currentAnimationFrameIndex at the last possible moment mAnim->currentAnimationFrameIndex = nextFrameIndex; - mAnim->currentAnimationFrameTime = mAnim->currentAnimationFrameTime + - TimeDuration::FromMilliseconds(timeout); return true; }