UIGraphicsBeginImageContextWithOptions crashes for certain values of CGSize

Originator:michael.der.schwarz
Number:rdar://41210285 Date Originated:Mon, 18 Jun 2018
Status:Open Resolved:
Product:Core Graphics Product Version:11.4
Classification:Crash Reproducible:Always
 
Summary:
The call to UIGraphicsBeginImageContextWithOptions(…) leads to a crash (terminated due to memory issue) when certain sizes are provided as input parameter.

Steps to Reproduce:
Call UIGraphicsBeginImageContextWithOptions with certain sizes (see example project) on an iPad Pro (A1584)

Expected Results:
Shouldn't crash, instead should return nil when retrieving the context with UIGraphicsGetCurrentContext.

Actual Results:
Crashes with "terminated due to memory issue"

Version/Build:
iOS 11.4

Configuration:
The attached app was executed on an iPad Pro (A1584) with debugger attached. It is also reproducible on an iPad Air (MD795FD/A) by reducing the sizes used in the example by a factor of approx. 0.5.

Comments


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!