Skip to content

Commit 0d6e4fe

Browse files
authored
Merge pull request SDWebImage#3813 from jiangleisir/feature/jianglei_crashfix
crashfix: SDImageIOAnimatedCoder OOM issue during animated image playing
2 parents cac9a55 + 88a57ce commit 0d6e4fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SDWebImage/Private/SDImageFramePool.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,16 @@ - (void)prefetchFrameAtIndex:(NSUInteger)index {
109109

110110
if (self.fetchQueue.operationCount == 0) {
111111
// Prefetch next frame in background queue
112-
id<SDAnimatedImageProvider> animatedProvider = self.provider;
113112
@weakify(self);
114113
NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
115114
@strongify(self);
116115
if (!self) {
117116
return;
118117
}
118+
id<SDAnimatedImageProvider> animatedProvider = self.provider;
119+
if (!animatedProvider) {
120+
return;
121+
}
119122
UIImage *frame = [animatedProvider animatedImageFrameAtIndex:index];
120123

121124
[self setFrame:frame atIndex:index];

0 commit comments

Comments
 (0)