-[SKTexture textureByGeneratingNormalMapWithSmoothness:contrast:] crashes with EXC_BAD_ACCESS with smoothness value of 1.0
| Originator: | brandon | ||
| Number: | rdar://17783884 | Date Originated: | July 23, 2014 |
| Status: | Resolved | Resolved: | |
| Product: | OS X SDK | Product Version: | OS X 10.10 (14A298i) |
| Classification: | Serious bug | Reproducible: | Always |
Summary: In the documentation for SKTexture the phrase "A number between 0.0 and 1.0" is used often, usually along with an explanation that the value 0.0 or 1.0 is inclusive in that range. However, when using `textureByGeneratingNormalMapWithSmoothness:contrast:`, where the documentation states "A number between 0.0 and 1.0 indicating how much the texture should be smoothed before the normal map is generated. A value of 0.0 means that the texture is not smoothed at all before being processed", a smoothness of 1.0 will cause an EXC_BAD_ACCESS. Steps to Reproduce: 1. Install Xcode 2. Create a new Sprite Kit project 3. Create an SKTexture 4. Attempt to create a normal map texture from the texture in step 3, like: `[texture textureByGeneratingNormalMapWithSmoothness:0.9999999 contrast:1.0];` 5. Observe that it doesn't crash at that line (assuming 64-bit) 6. Attempt to create a normal map texture from the texture in step 3, like: `[texture textureByGeneratingNormalMapWithSmoothness:1.0 contrast:1.0];` 7. Observe that it does crash at that line Expected Results: Calling that method should never crash. If 1.0 is an invalid value then handle it and document it. Actual Results: Calling that method crashes. Version: Xcode Version 6.0 (6A267n) OS X 10.10 (14A298i) Notes: To test the sample project, click inside the window to try creating normal map textures with different smoothness values.
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!