From 89aa62f28b9ff8f7d5e5a1c46dc46b9fef4bfc4e Mon Sep 17 00:00:00 2001 From: Naoyoshi Aikawa Date: Thu, 9 Nov 2017 19:23:29 +0900 Subject: [PATCH] Fix for iOS11.2 --- iOS-WebP/UIImage+WebP.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iOS-WebP/UIImage+WebP.m b/iOS-WebP/UIImage+WebP.m index 2b6165f..61a26b8 100644 --- a/iOS-WebP/UIImage+WebP.m +++ b/iOS-WebP/UIImage+WebP.m @@ -159,7 +159,7 @@ + (UIImage *)imageWithWebPData:(NSData *)imgData error:(NSError **)error // Construct UIImage from the decoded RGBA value array uint8_t *data = WebPDecodeRGBA([imgData bytes], [imgData length], &width, &height); - CGDataProviderRef provider = CGDataProviderCreateWithData(config, data, config->options.scaled_width * config->options.scaled_height * 4, free_image_data); + CGDataProviderRef provider = CGDataProviderCreateWithData(config, data, (config->options.scaled_width || width) * (config->options.scaled_height || height) * 4, free_image_data); CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault |kCGImageAlphaLast;