SDWebImage: iOS 17 (from beta 7+) Force Decode on HEIF/AVIF image may crash

New Issue Checklist

Issue Info

Info Value
Platform Name ios
Platform Version 17.0 *but may be not exclusive
SDWebImage Version 5.18.0
Integration Method cocoapods
Xcode Version xcode 14.3.1
Repro rate can’t reproduce

Issue Description and Steps

We are seeing two new issues that are very similar, since we have updated from 5.16.0. to 5.18.0. . In addition to .jpg and .png we also have recently added support for .webp (iOS 14 and iOS 15) and .avif (iOS 16 and above)

Screenshot 2023-09-18 at 4 17 36 PM

Screenshot 2023-09-18 at 4 18 35 PM

Screenshot 2023-09-18 at 4 18 49 PM

Any clues on what might be causing this? Would you advise to downgrade to 5.16.0 before the issues started to happen? Or perhaps, if this is iOS 17, SDWebImage needs to catchup?

About this issue

  • Original URL
  • State: open
  • Created 9 months ago
  • Comments: 18 (13 by maintainers)

Most upvoted comments

Seems Apple’s ImageIO decoder bug, no known way currently to workaround.

A quick hack is to use SDWebImageHEIFCoder (open-sourced, provided by me and use libheif instead of ImageIO) for iOS 17+ if you really care about the crash ratio.

Or maybe need further information to reproduce the crash, for example, can some special HEIF/AVIF image files trigger that crash ? So that we can fire radar to Apple’s ImageIO team

@joaopdcgarcia @magicfengg