From d9067a16fe2871b638fafa8774be8e2de8265d1c Mon Sep 17 00:00:00 2001 From: Andrew Osmond Date: Fri, 17 Nov 2017 07:54:50 -0500 Subject: [PATCH] Bug 1368776 - Part 17. Fix how we could reuse an incorrect image container instead of creating a new one. r=me --- image/Image.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/image/Image.cpp b/image/Image.cpp index 57303229d166..097a76c6d257 100644 --- a/image/Image.cpp +++ b/image/Image.cpp @@ -125,10 +125,14 @@ ImageResource::GetImageContainerImpl(LayerManager* aManager, } else if (!container) { // Stop tracking if our weak pointer to the image container was freed. mImageContainers.RemoveElementAt(i); + } else { + // It isn't a match, but still valid. Forget the container so we don't + // try to reuse it below. + container = nullptr; } } - if (i >= 0 && container) { + if (container) { switch (entry->mLastDrawResult) { case DrawResult::SUCCESS: case DrawResult::BAD_IMAGE: