Bug 1501120 - Fix faulty assert when calculating memory footprint of animation. r=tnikkel

Differential Revision: https://phabricator.services.mozilla.com/D9506
This commit is contained in:
Andrew Osmond 2018-10-23 07:59:18 -04:00
parent 782c5ea2b9
commit 8066d5c0b3

View File

@ -305,10 +305,13 @@ AnimationFrameDiscardingQueue::AddSizeOfExcludingThis(MallocSizeOf aMallocSizeOf
for (const RefPtr<imgFrame>& frame : mDisplay) {
++i;
if (mSize < i) {
// First frame again, we already covered it above.
MOZ_ASSERT(mFirstFrame.get() == frame.get());
i = 1;
continue;
if (mFirstFrame.get() == frame.get()) {
// First frame again, we already covered it above. We can have a
// different frame in the first frame position in the discard queue
// on subsequent passes of the animation. This is useful for recycling.
continue;
}
}
frame->AddSizeOfExcludingThis(aMallocSizeOf,