From 2ae9ba3881ce7dd12ea7621dc93adf315e04db54 Mon Sep 17 00:00:00 2001 From: chrisnojima Date: Mon, 14 Jan 2019 17:04:22 -0500 Subject: [PATCH] fix incorrect type which makes animated gifs not loop forever on device. Fixes #22985 --- Libraries/Image/RCTGIFImageDecoder.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/Image/RCTGIFImageDecoder.m b/Libraries/Image/RCTGIFImageDecoder.m index 0943493c9a283c..73fef5381a7c38 100644 --- a/Libraries/Image/RCTGIFImageDecoder.m +++ b/Libraries/Image/RCTGIFImageDecoder.m @@ -32,7 +32,7 @@ - (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData { CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)imageData, NULL); NSDictionary *properties = (__bridge_transfer NSDictionary *)CGImageSourceCopyProperties(imageSource, NULL); - NSUInteger loopCount = 0; + CGFloat loopCount = 0; if ([[properties[(id)kCGImagePropertyGIFDictionary] allKeys] containsObject:(id)kCGImagePropertyGIFLoopCount]) { loopCount = [properties[(id)kCGImagePropertyGIFDictionary][(id)kCGImagePropertyGIFLoopCount] unsignedIntegerValue]; if (loopCount == 0) { @@ -43,7 +43,7 @@ - (RCTImageLoaderCancellationBlock)decodeImageData:(NSData *)imageData loopCount += 1; } } - + UIImage *image = nil; size_t imageCount = CGImageSourceGetCount(imageSource); if (imageCount > 1) {