Rendering a PDF locks up the render operation, never returning. Regression because of AppleJPEG.

Originator:steipete
Number:rdar://19865091 Date Originated:17-Feb-2015 10:36 PM
Status:Open Resolved:
Product:iOS SDK Product Version:8.1.3
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
Rendering a PDF locks up the render operation, never returning.

Steps to Reproduce:
Open attached example.
Run.
Observe that it is looping after rendering the first image successfully.

There is no crash, but the renderer is never finishing (thus, I can’t provide a crash log since it’s a hang)

Expected Results:
Should render as expected.

Actual Results:
Freezes/Loops somewhere in CGImageReadGetCachedImageBlockData

https://gist.github.com/steipete/bc12497fd55dadc346b0

Regression:
Seems to be related to AppleJPEG. Works fine in iOS 7.

Notes:
Removing CGContextSetInterpolationQuality fixes the issue. kCGInterpolationHigh or kCGInterpolationMedium cause a freeze. This took a crazy long time to find out… appreciate any feedback on this.

Comments

Still happening with iOS 10.0.1 GM.

Reproduce on an iPad on real hardware. Does work in Simulator or on iPhone 6 Plus.

Can't provide example publicly, contains proprietary data.


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!