SDWebImage / SDWebImage

Asynchronous image downloader with cache support as a UIImageView category
https://sdwebimage.github.io
MIT License
25.05k stars 5.97k forks source link

SDImageIOAnimatedCoder createFrameAtIndex crash Still exist in SDWebimage 5.15.1 #3596

Open lzttxs opened 1 year ago

lzttxs commented 1 year ago

SDAnimatedImagePlayer crash

Platform Name ios Platform Version 16.6 SDWebImage Version 5.15.1 Integration Method cocoapods Xcode Version Xcode 14.1 Repro rate 10%

Found a lot of this problem, found before, but has not been solved, hoping to solve this problem, thanks

SIGABRT libsystem_kernel.dylib ___pthread_kill

Issue Description and Steps

crash stack

0 libsystem_kernel.dylib _pthread_kill + 8 1 libsystem_pthread.dylib _pthread_kill + 268 2 libsystem_c.dylib _abort + 180 3 libsystem_c.dylib _err 4 CoreFoundation _CFDataGetBytes.cold.4 5 CoreFoundation _CFDataGetBytes + 332 6 ImageIO _CGImageGetImageSource + 156 7 UIKitCore -[_UIImageCGImageContent initWithCGImage:scale:] + 40 8 UIKitCore -[UIImage initWithCGImage:scale:orientation:] + 68 9 SDWebImage +[SDImageIOAnimatedCoder createFrameAtIndex:source:scale:preserveAspectRatio:thumbnailSize:options:] + 884 10 SDWebImage -[SDImageIOAnimatedCoder animatedImageFrameAtIndex:] + 240 11 SDWebImage -[SDAnimatedImage animatedImageFrameAtIndex:] + 152 12 SDWebImage __43-[SDAnimatedImagePlayer displayDidRefresh:]_blockinvoke + 52 13 Foundation NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK + 24 14 Foundation -[NSBlockOperation main] + 104 15 Foundation ___NSOPERATION_IS_INVOKING_MAIN + 16 16 Foundation -[NSOperation start] + 708 17 Foundation _NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION_ + 16 18 Foundation NSOQSchedule_f + 172 19 libdispatch.dylib __dispatch_block_async_invoke2 + 148

lzttxs commented 1 year ago

How to fix it?

dreampiggy commented 1 year ago

Pass the AvoidLazyDecoding = @(YES) from the context options SDWebImageContextDecodeOptions for your animated image loading

hnny09 commented 11 months ago

How to fix it?

fixed bug?