diff --git a/SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m b/SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m index 6036938..a0111e4 100644 --- a/SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m +++ b/SDWebImageAVIFCoder/Classes/SDImageAVIFCoder.m @@ -348,6 +348,7 @@ - (UIImage *)animatedImageFrameAtIndex:(NSUInteger)index { SD_LOCK(_lock); avifResult decodeResult = avifDecoderNthImage(_decoder, (uint32_t)index); if (decodeResult != AVIF_RESULT_OK) { + SD_UNLOCK(_lock); return nil; } CGImageRef imageRef = SDCreateCGImageFromAVIF(_decoder->image);