From 2e316954d80d2a3b7a38e3806a2981fc6f492b8b Mon Sep 17 00:00:00 2001 From: Michael Schneider Date: Fri, 27 Apr 2018 08:01:21 -0700 Subject: [PATCH] Fix overlapping accesses to image container --- Source/Classes/GIFAnimatable.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Classes/GIFAnimatable.swift b/Source/Classes/GIFAnimatable.swift index 507ef80..f7349a1 100644 --- a/Source/Classes/GIFAnimatable.swift +++ b/Source/Classes/GIFAnimatable.swift @@ -189,7 +189,8 @@ extension GIFAnimatable { /// Updates the image with a new frame if necessary. public func updateImageIfNeeded() { if var imageContainer = self as? ImageContainer { - imageContainer.image = activeFrame ?? imageContainer.image + let container = imageContainer + imageContainer.image = activeFrame ?? container.image } else { layer.contents = activeFrame?.cgImage }